背景
操作系统:龙蜥8.6
内核:4.19.91-26.an8.x86_64
问题:yum install -y nfs-utils rpcbind 报错:
Cannot download repomd.xml: Cannot download repodata/repomd.xml
排查
CentOS 8操作系统版本结束了生命周期(EOL),Linux社区已不再维护该操作系统版本。CentOS 8的源地址http://mirror.centos.org/centos/8/内容已移除,目前第三方的镜像站中均已移除CentOS 8的源。龙蜥8.6和Centos 8 用的同源 需要更换
解决
将yum源换为国内流行的阿里云
具体操作
#备份旧yun源
cd /etc/repos.d/
sudo rename '.repo' '.repo.bak' /etc/yum.repos.d/*.repo
#下载阿里云yun源
sudo wget https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo -O /etc/yum.repos.d/Centos-vault-8.5.2111.repo
sudo wget https://mirrors.aliyun.com/repo/epel-archive-8.repo -O /etc/yum.repos.d/epel-archive-8.repo
#修改源链接
sed -i 's/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo
sed -i 's/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g' /etc/yum.repos.d/epel-archive-8.repo
#清除,更新缓存
yum clean all && yum makecache
#测试
yum install -y nfs-utils rpcbind
已解决!