备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
下载新的CentOS-Base.repo 到/etc/yum.repos.d/
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
运行 yum makecache 生成缓存
让yum重新缓存新的数据
yum update
sohu的源:http://mirrors.sohu.com/help/CentOS-Base-sohu.repo
163的源:http://mirrors.163.com/.help/CentOS6-Base-163.repo
阿里云的源:http://mirrors.aliyun.com/repo/Centos-7.repo
参考:https://www.jianshu.com/p/e63903fd09f0
参考:https://blog.csdn.net/qq_36731677/article/details/58288979