解决:Failed to download metadata for repo ‘base‘: Cannot download repomd.xml: Cannot download repodata

这篇具有很好参考价值的文章主要介绍了解决:Failed to download metadata for repo ‘base‘: Cannot download repomd.xml: Cannot download repodata。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

error: failed to download metadata for repo 'base': cannot download repomd.x,问题解决,linux

1.先查看本机的系统信息

[root@h0436 h0436 zlong]# cat /etc/redhat-release

2.进入yum.repos.d

[root@h0436 zlong]# cd /etc/yum.repos.d

3.查看镜像文件(看看你需要修改的哪个文件)

[root@h0436 yum.repos.d]# ls
CentOS-Base.repo         CentOS-Base.repo.bak  epel.repo
CentOS-Base.repo.backup  docker-ce.repo


4.修改文件(我的是CentOS-Base.repo.backup文件)

[root@h0436 yum.repos.d]# vim CentOS-Base.repo.backup 
 

5.如果你找不到在哪个文件夹,你就每个文件夹都vim 进去看看,找到CentOS-Base.repo就行

error: failed to download metadata for repo 'base': cannot download repomd.x,问题解决,linux

6.复制下面这一段配置就行,按键盘上“i”编辑,按ESC退出。如果要保存退出就按:wq,如果不保存退出就按:q  (图中标红的地方都是改过之后的地方)

[base]
name=CentOS-8 - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/8/os/$basearch/
        http://mirrors.aliyuncs.com/centos/8/os/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/8/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-8

#released updates 
[updates]
name=CentOS-8 - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/8/updates/$basearch/
        http://mirrors.aliyuncs.com/centos/8/updates/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/8/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-8

#additional packages that may be useful
[extras]
name=CentOS-8 - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/8/extras/$basearch/
        http://mirrors.aliyuncs.com/centos/8/extras/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/8/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-8

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-8 - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/8/centosplus/$basearch/
        http://mirrors.aliyuncs.com/centos/8/centosplus/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/8/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-8

#contrib - packages by Centos Users
[contrib]
name=CentOS-8 - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/8/contrib/$basearch/
        http://mirrors.aliyuncs.com/centos/8/contrib/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/8/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-8

7.清除缓存

[root@h0436 yum.repos.d]# yum clean all


8.加载缓存

[root@h0436 yum.repos.d]# yum makecache

error: failed to download metadata for repo 'base': cannot download repomd.x,问题解决,linux

希望对你有所帮助,谢谢~文章来源地址https://www.toymoban.com/news/detail-799952.html

到了这里,关于解决:Failed to download metadata for repo ‘base‘: Cannot download repomd.xml: Cannot download repodata的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包