1, first back up the system comes with yum source profile /etc/yum.repos.d/CentOS-Base.repo
[root@localhost ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2, yum source configuration file into the folder where you
[root@localhost ~]# cd /etc/yum.repos.d/
3, 163 downloads yum configuration file to the source folder above the file
CentOS7 [root@localhost yum.repos.d]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo CentOS6 [root@localhost yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo CentOS5 [root@localhost yum.repos.d]# wget http://mirrors.163.com/.help/CentOS5-Base-163.repo
4, run yum makecache generate cache
[root@localhost yum.repos.d]# yum makecache