
yum --v update
在 AWS 上全新安裝 CentOS 8 時,我得到:
Error: Failed to download metadata for repo 'AppStream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
稍微閱讀一下就會發現,CentOS 8 似乎正在成為 CentOS Stream 8,並且所有鏡像都顯示該產品已結束生命週期:http://mirror.centos.org/centos-8/8/readme
如果我開啟/etc/yum.repos.d/CentOS-AppStream.repo
引用的網址,則解析為:http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=ec2
這似乎就是上述問題的原因。正如它所說
“無效的發布/儲存庫/架構組合”
怎麼辦? CentOS 7 是我唯一的選擇嗎?我在 AWS 中找不到任何「CentOS Stream 8」映像。
答案1
網址應該是http://mirrorlist.centos.org/?release=8-stream&arch=x86_64&repo=AppStream&infra=ec2,特別是8-stream
隨著發布。
在官方頁面上還有一些有關從非串流切換到串流的其他說明:https://www.centos.org/centos-stream/
另請注意,如果您使用 AWS,那麼您可能想要利用建置 AMI 來基於流向您的環境提供穩定的映像。設定管道來每週建立一個基礎映像非常容易,然後可以用於測試和部署。這可以減輕使用基於流的版本的一些“風險”。