參考: 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