新年伊始我的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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM