2022年8月23日 星期二

【IT Notes】CentOS8下載工具出現“Failed to download metadata for repo 'AppStream' “錯誤

 CentOS已經於去年底停更,所以安裝完後AppStream的repo會在安裝工具或套件時出錯,跳出找不到可安裝套件的訊息,官方可以說是放棄CentOS8的更新。

解決方式:將AppStream和BaseOS repo都更新

# cd /etc/yum.repos.d
# vi CentOS-AppStream.repo
# vi CentOS-Base.repo

在repo檔案內更新內容,舊的連結註解掉、添增新的url

[baseos]
name=CentOS Linux $releasever - BaseOS
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/
baseurl=https://vault.centos.org/centos/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

[appstream]
name=CentOS Linux $releasever - AppStream
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/$releasever/AppStream/$basearch/os/
baseurl=https://vault.centos.org/centos/$releasever/AppStream/$basearch/os/ 
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial


接著要安裝工具時又出現以下錯誤,很煩!
錯誤:無法下載「appstream」軟體庫的中介資料:Cannot prepare internal mirrorlist: No URLs in mirrorlist

解決方式:繼續添加新的下載連結
# 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-*
# yum install wget -y
終於下載完成了!



沒有留言:

張貼留言

【IT Notes】透過api移轉Gmail到Exchange

 在雲端裡面串接api不是一件很好學的技術,第一次有機會學習到將GWS的Gmail信件全部轉移到M365的Exchange,其實方法很多種,像以前用的pst檔匯出轉移的方式等,但透過api串接,可以批次和排程轉移,是非常方便且準確的作法。唯一讓人感到困難的是學習成本不小,通常需要...