Centos7 change yum source and update system

[1] First backup
/etc/yum.repos.d/CentOS-Base.repo

 

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

 

[2] into the source yum configuration files folder

[root@localhost yum.repos.d]# cd /etc/yum.repos.d/

 

[3] 163 downloaded yum source profile, into /etc/yum.repos.d/

[root@localhost yum.repos.d]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

 Please make the appropriate backup operation before

CentOS 5

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

 

CentOS 6

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

 

CentOS 7

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

 

[4] generating the cache operation yum makecache

[root@localhost yum.repos.d]# yum makecache

 

[5] Update System

[root@localhost yum.repos.d]# yum -y update

 

[6] mounted vim editor

[root@localhost ~]# yum -y install vim*

 

 

/etc/yum.repos.d/CentOS-Base.repo

 

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

 

[2] into the source yum configuration files folder

[root@localhost yum.repos.d]# cd /etc/yum.repos.d/

 

[3] 163 downloaded yum source profile, into /etc/yum.repos.d/

[root@localhost yum.repos.d]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

 Please make the appropriate backup operation before

CentOS 5

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

 

CentOS 6

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

 

CentOS 7

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

 

[4] generating the cache operation yum makecache

[root@localhost yum.repos.d]# yum makecache

 

[5] Update System

[root@localhost yum.repos.d]# yum -y update

 

[6] mounted vim editor

[root@localhost ~]# yum -y install vim*

 

 

Guess you like

Origin www.cnblogs.com/oneWhite/p/12064407.html