更换Centos8 yum源

Centos 8 在 2021年底仓库全部停止运营, 之前的源都不能用了

问题

阿里云centos yum报错 - Status code: 404 for https://mirrors.aliyun.com/centos/centos/8/AppStream/x86_6

替换源

在进行修改之前最好将 /etc/yum.repos.d/ 下的所有文件做一个备份,当出现不可知的情况时,可以通过 cat /var/log/dnf.log 查看日志并自行分析。

1.如果服务器在国内,可以使用阿里源:

vi /etc/yum.repos.d/CentOS-AppStream.repo

1
2
3
4
5
name=CentOS-$releasever - AppStream
baseurl=http://mirrors.aliyun.com/centos/8-stream/AppStream/x86_64/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

更换Centos8 yum源
https://blog.readcode.top/posts/297d71f2.html
作者
YuBaiCai
发布于
2022年8月26日
许可协议