CentOS Linux 8操作系统版本在2021年12月31日结束了生命周期(EOL),Linux社区不再维护该操作系统版本。所有的CentOS Linux 8的yum源都无效!
所有就需要自己去将yum 源更新为可用的,以下是我成功的方法;
#进入原仓库的配置文件
cd /etc/yum.repos.d/
#把CentOS- 开头的文件中所有的mirrorlist 替换为#mirrorlist;就是注释掉原来的源
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
#把CentOS- 开头的文件中所有的‘#baseurl=http://mirror.centos.org’替换为‘baseurl=http://vault.centos.org’
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
yum update -y
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
yum clean all
yum makecache
这样就成功啦!
如果还是不行,可以直接将我这里提供的yum.repos.d 压缩包直接拷贝过去, 从yum update -y 走一遍
链接: https://pan.baidu.com/s/1hhuIDKr0a2pftM9JChI-ig 提取码: b81h