close

centos8 中當使用 yum安裝軟體時出現錯誤 No URLs in mirrorlist

2022-12-30_102128.png

錯誤:無法下載「appstream」軟體庫的中介資料:Cannot prepare internal mirrorlist: No URLs in mirrorlist

錯誤:無法下載存儲庫“AppStream”的元數據:無法準備內部鏡像清單:鏡像清單中沒有URL

導致沒辦法再安裝軟體。

因為從在2022年1月31日,CentOS團隊終於從官方鏡像中移除CentOS 8的所有安裝軟體。

2022-12-30_143259.png

 

CentOS 8已於2021年12月31日壽終正寢,但軟體包仍在官方鏡像上保留了一段時間,現在他們被轉移到https://vault.centos.org。

解決方法
如果你仍然需要運行CentOS 8,你可以在/etc/yum.repos.d中更新一下軟體源。使用vault.centos.org代替mirror.centos.org。

Here we use the sed command to edit the required directives or parameters in the repo configuration files:

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-*

Alternatively, you can also point to the Cloudflare-based vault repository, by running the following commands:

sudo sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*
sudo sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.epel.cloud|g' /etc/yum.repos.d/CentOS-Linux-*

Now you should be able to update CentOS or install packages without any error:

 

2023-01-07_141921.png

2023-01-07_142044.png

If you wish to migrate from CentOS 8 to Rock Linux 8 or AlamLinux 8, check these guides:

 

How to Migrate from CentOS 8 to Rocky Linux 8
How to Migrate from CentOS 8 to AlmaLinux 8.5

 

參考文章 :

[CentOS 8] 無法使用: No URLs in mirrorlist error @新精讚 (sfs.tw)

Fix Error: Failed to Download Metadata for Repo 'AppStream' (tecmint.com)

Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist Solution for Centos8 yum package install error - rtt - IT Resource (realtechtalk.com)

Cent os 搬移至 AlmaLinux ,Rocky Linux  系統

How to Migrate from CentOS 8 to AlmaLinux 8.5 (tecmint.com)

How to Migrate from CentOS 8 to Rocky Linux 8 (tecmint.com)

Rocky Linuxとは?CentOS 8の後継OSの特徴と他OSとの比較について解説 | ベアケアブログ (barecare.jp)

AlmaLinuxとは?CentOS 8の後継OSの特徴と導入方法について解説 | ベアケアブログ (barecare.jp)


arrow
arrow

    sungshu 發表在 痞客邦 留言(0) 人氣()