http://mirrors.cloud.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6

1、问题描述:

http://mirrors.aliyun.com/centos/6/os/x86_64/repodata/repomd.xml:
[Errno 14] PYCURL ERROR 22 - “The requested URL returned error: 404
Not Found” Trying other mirror.
http://mirrors.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml:
[Errno 14] PYCURL ERROR 7 - “couldn’t connect to host” Trying other
mirror.
http://mirrors.cloud.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml:
[Errno 14] PYCURL ERROR 6 - “Couldn’t resolve host
‘mirrors.cloud.aliyuncs.com’” Trying other mirror. Error: Cannot
retrieve repository metadata (repomd.xml) for repository: base. Please
verify its path and try again

2、解决方案:

这是因为我这个虚拟机用的centos6的镜像,但是这个版本已经找不到了,我们替换为7就可以,步骤如下。

修改CentOS-Base.repo文件

vi /etc/yum.repos.d/CentOS-Base.repo

使用全局替换命令,将该文件中$releasever全部改成7

:%s/$releasever/7/g

清空并生成缓存

yum clean all
yum makecache
posted @ 2021-05-18 10:05  别团等shy哥发育  阅读(435)  评论(0)    收藏  举报