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

一、背景
        在使用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 无法连接到镜像 Error: Cannot retrieve repository metadata (repomd.xml)

四、解决
        经过各种查询,终于找到一个还在维护的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

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

参考地址:

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

上一篇:Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again错误


下一篇:Unable to retrieve computer resource问题处理