linux為repo 'AppStream'下載元數據失敗的解決
查看網絡有無連接,或者防火墻。
Centos8下載元數據失敗(Cannot download repomd.xml: Cannot download repodata/repomd.xml)背景新裝了Centos8操作系統,安裝yum-utils時報錯。
[parallels@localhost yum.repos.d]$ sudo yum install -y yum-utils CentOS Linux 8 - AppStream0.0 B/s | 0 B 00:00 Errors during downloading metadata for repository 'appstream': - Curl error (6): Couldn't resolve host name for http://mirror.cloud.aliyuncs.com/centos-vault/8.5.2111/AppStream/x86_64/os/repodata/repomd.xml [Could not resolve host: mirror.cloud.aliyuncs.com]錯誤:為倉庫 'appstream' 下載元數據失敗 : Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
問題分析經查詢,CentOS8操作系統版本生命周期結束,Linux社區不再維護,需要還源。
解決辦法將yum源換為國內流行的阿里云
1)備份
cd /etc/repos.d/sudo rename '.repo' '.repo.bak' /etc/yum.repos.d/*.repo?2)從阿里云下載從阿里云下載
sudo wget https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo -O /etc/yum.repos.d/Centos-vault-8.5.2111.reposudo wget https://mirrors.aliyun.com/repo/epel-archive-8.repo -O /etc/yum.repos.d/epel-archive-8.repo3)替換源鏈接
sed -i 's/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g' ?/etc/yum.repos.d/Centos-vault-8.5.2111.repo?sed -i 's/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g' ?/etc/yum.repos.d/epel-archive-8.repo4)清除并更新緩存
yum clean all && yum makecache5)驗證
sudo yum update總結以上為個人經驗,希望能給大家一個參考,也希望大家多多支持好吧啦網。