参考: https://zhuanlan.zhihu.com/p/78471090
清除缓存
yum clean all
元数据建立
yum makecache
更新
yum update
cd /etc/yum.repos.d/
备份yum
mv CentOS-Base.repo CentOS-Base.repo.backup
下载新的centos7的 CentOS-Base.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
再创建缓存
yum makecache