关于修改源为阿里云之后依然报错问题
过时的解决方案
找到配置文件打开 /etc/yum.repos.d 修改baseurl 为阿里云的地址 :
cd /etc/yum.repos.d
vim CentOS-Base.repo
[BaseOS]
baseurl=https://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
出错原因
这里打开https://mirrors.aliyun.com/centos/8/可以看到里面文件列表已经空了
centos8的解决方法(centos8官方源已下线,切换centos-vault源)
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
cd /etc/yum.repos.d
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
yum makecache
然后yum update -y就没问题了
过期的教程害死人啊,推荐以后再需要更换源的教程直接看阿里云的官方教程,因为更新比较快
https://developer.aliyun.com/mirror/