新年伊始我的centos8没法更新了

22年春节后centos8竟然没法更新了,提示No URLs in mirrorlist如下:

yum update

Repository extras is listed more than once in the configuration
Repository fasttrack is listed more than once in the configuration
CentOS Linux 8 - AppStream                       77  B/s |  38  B     00:00
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

查了下资料原来是CentOS被RedHat收购,更新持续到2021年12月31日。CentOS团队终止了源中CentOS8的所有软件包。但是被暂时移到了https://vault.centos.org ,会保留一段时间。未来不知道什么时候就不能用了。

我暂时把源的地址改到vault这个URL将CentOS8迁移成了CentOS Stream 8。

# 首先备份原有配置文件
cp -r /etc/yum.repos.d ~
# 将YUM配置文件中源地址更换为vult的URL
sudo sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-*
sudo sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-*
# 安装Centos Stream源并且替换成Centos Stream源
dnf install centos-release-stream
dnf swap centos-{linux,stream}-repos
# 迁移并且替换Centos8的软件和内核,该过程时间较长建议使用screen避免断开远程连接
dnf distro-sync

参考:

https://forketyfork.medium.com/centos-8-no-urls-in-mirrorlist-error-3f87c3466faa

https://www.nixops.me/articles/migrate-to-centos-stream-8.html

posted @ 2022-02-03 15:22  redcat8850  阅读(1652)  评论(0编辑  收藏  举报