1.源所在的目录:
/etc/yum.repos.d/
在更换之前可以先备份自己的源,防止出错,
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2.抓取
Centos 5.X
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo //阿里
wget http://mirrors.163.com/.help/CentOS5-Base-163.repo //网易
Centos 6.X
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo //阿里
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo//网易
Centos 7.X
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo //阿里
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo //网易
3.下载成功后
yum clean all
yum makecache
完成!