由于官方已经在2021/12/31停止了对CentOS 8的支持,所以需要更新 yum 源,才能使用
这里用的是阿里的 yum 镜像源
将源文件备份
cd /etc/yum.repos.d/ && mkdir backup && mv *repo backup/
下载阿里源文件
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
更新源里面的地址
sed -i -e "s|mirrors.cloud.aliyuncs.com|mirrors.aliyun.com|g " /etc/yum.repos.d/CentOS-*
sed -i -e "s|releasever|releasever-stream|g" /etc/yum.repos.d/CentOS-*
生成缓存
yum clean all && yum makecache
# 老方法 dnf install centos-release-stream 不再推荐使用
dnf swap centos-linux-repos centos-stream-repos
dnf distro-sync
# 查看当前版本
cat /etc/centos-release
CentOS Stream release 8
建议更新后重启一下。
CentOS Stream迁移后还原回CentOS 8:
Original: https://www.cnblogs.com/niuben/p/16258362.html
Author: 牛奔
Title: linux centos8 mirrorlist: No URLs in mirrorlist,更新yum源
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/8749/
转载文章受原作者版权保护。转载请注明原作者出处!