1.删除老版的yum文件
rm -rf /etc/yum.repos.d
mkdir /etc/yum.repos.d
2.找到阿里云镜像,下载repo
#centos 7
wget http://mirrors.aliyun.com/repo/Centos-7.repo
cp Centos-7.repo /etc/yum.repos.d/CentOS-Base.repo
#centos 8
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
3.清理yum缓存,重新安装
yum clean all
yum makecache
yum update
注意:本文归作者所有,未经作者允许,不得转载