Centos8 解决 ‘AppStream‘ 下载元数据失败 : Cannot download repomd.xml: Cannot download repodata/repomd.xml

 这个错误表明在尝试更新yum缓存时,无法下载AppStream仓库的元数据。原因可能是镜像源不可用或者URL不正确。

我是centos8

(1)使用文本编辑器打开AppStream仓库的配置文件。(我的配置文件是/etc/yum.repos.d/AppStream.repo)

默认的配置文件为

/etc/yum.repos.d/CentOS-Linux-AppStream.repo

/etc/yum.repos.d/CentOS-Linux-BaseOS.repo

/etc/yum.repos.d/CentOS-Linux-Extras.repo

可以直接在默认文件里面改

vim /etc/yum.repos.d/AppStream.repo

 进入文件后,输入

[AppStream]
name=AppStream
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/8.0.1905/AppStream/$basearch/os/
gpgcheck=0
enabled=1
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/centos/RPM-GPG-KEY-CentOS-Official

 (2)使用文本编辑器打开BaseOS仓库的配置文件。(我的配置文件是/etc/yum.repos.d/BaseOS.repo)

vi /etc/yum.repos.d/BaseOS.repo

  进入文件后,输入

[BaseOS]
name=BaseOS
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/8.0.1905/BaseOS/$basearch/os/
gpgcheck=0
enabled=1
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/centos/RPM-GPG-KEY-CentOS-Official

(3) 使用文本编辑器打开Extras仓库的配置文件。(我的配置文件是/etc/yum.repos.d/Extras.repo)

vim /etc/yum.repos.d/Extras.repo

进入文件后,输入

[Extras]
name=extras
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/8.0.1905/extras/$basearch/os/
gpgcheck=0
enabled=1
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/centos/RPM-GPG-KEY-CentOS-Official

 最后

yum clean all
yum makecache

 显示元数据缓存已建立。就成功了

如果以上解决了你的问题,给我点个赞吧

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值