您的位置:首頁技術文章
文章詳情頁

linux為repo 'AppStream'下載元數據失敗的解決

瀏覽:53日期:2023-09-26 20:56:15
目錄linux為repo 'AppStream'下載元數據失敗顯示錯誤 解決Centos8下載元數據失敗(Cannot download repomd.xml: Cannot download repodata/repomd.xml)背景問題分析解決辦法總結linux為repo 'AppStream'下載元數據失敗顯示錯誤 為 repo 'AppStream' 下載元數據失敗錯誤:為 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.repo

3)替換源鏈接

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.repo

4)清除并更新緩存

yum clean all && yum makecache

5)驗證

sudo yum update總結

以上為個人經驗,希望能給大家一個參考,也希望大家多多支持好吧啦網。

標簽: Linux
国产综合久久一区二区三区