yum 无法连接到镜像 Error: Cannot retrieve repository metadata (repomd.xml)

1 篇文章 0 订阅
1 篇文章 0 订阅

一、背景
        在使用yum命令下载wget时,无法下载
        外网能够连接,防火墙已经关闭了
二、报错信息

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Invalid release/repo/arch combination/
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Invalid release/repo/arch combination/
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Invalid release/repo/arch combination/
http://mirror.centos.org/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again


三、原因
        经过查找各种资料分析得出,该问题是yum 源的配置地址出问题了,低版本的yum源网址不在维护了
        以清华源为例,centos以下已经进行维护了,只有一个readme文件了,同时163的,阿里云等很多网址都不维护了,试了很多

四、解决
        经过各种查询,终于找到一个还在维护的yum源网址:https://vault.centos.org/
        在打开虚拟机,进入cd /etc/yum.repos.d/
        备份里面的CentOS-Base.repo
        新建一个CentOS-Base.repo,里面内容为:
        

   [base]
    name=CentOS-6
    baseurl=https://vault.centos.org/6.0/os/x86_64
    gpgcheck=0

       完成后再输入下面的命令:
        yum clean all
        yum makecache


        

参考地址:

https://blog.csdn.net/qq_43787603/article/details/90670645?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromBaidu-1.control&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromBaidu-1.control

https://www.cnblogs.com/binbingg/p/14082610.html

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值