备份
mv /etc/yum.repos.d/CentOS-Linux-BaseOS.repo /etc/yum.repos.d/CentOS-Linux-BaseOS.repo.backup
下载最新的源
wget -O /etc/yum.repos.d/CentOS-Linux-BaseOS.repo http://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
更改第二个配置文件
cd /etc/yum.repos.d
vi CentOS-Linux-AppStream.repo
内容:
baseurl=https://mirrors.aliyun.com/centos/$releasever-stream/AppStream/$basearch/os/
第三个配置文件
cd /etc/yum.repos.d
vi CentOS-Linux-Extras.repo
内容:
baseurl=https://mirrors.aliyun.com/centos/$releasever-stream/extras/$basearch/os/
清除yum缓存
yum clean all
生成新缓存
yum makecache
验证
yum repolist