原创Centos的Yum源地址报错404解决方案

8 0 0
大乐文章
2021-06-17

服务器上运行yum安装时候出现错误,错误信息如下

http://mirrors.aliyun.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
To address this issue please refer to the below wiki article 

https://wiki.centos.org/yum-errors

If above article doesn't help to resolve this issue please use https://bugs.centos.org/.

http://mirrors.cloud.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
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.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

也不管什么原因,这里先解决地址源的问题。

打开文件 /etc/yum.repos.d/CentOS-Base.repo

将内容替换为


[base]
name=CentOS-6.10 - Base
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/os/x86_64/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
[updates]
name=CentOS-6.10 - Updates
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/updates/x86_64/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
[extras]
name=CentOS-6.10 - Extras
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/extras/x86_64/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
[centosplus]
name=CentOS-6.10 - Plus
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/centosplus/x86_64/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
[contrib]
name=CentOS-6.10 - Contrib
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/contrib/x86_64/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

将内容的 6.10 替换为你系统centos版本相应的版本,最后确定能够打开链接,

查看centos系统版本命令 cat /etc/issue

如果运行还是报错,则需要修改文件 /etc/yum.repos.d/epel.repo

将文件内的 enabled=1 改为 enabled=0

我的问题解决了,希望能帮到你。

本站的所有数据收集于网络如有侵犯到您的权益请联系 admin@dale6.com 进行下架处理。提供的内容仅用于学习和测试,不保证内容的正确性。通过使用本站内容随之而来的风险与本站无关。

转载时必须带上转载链接或本文链接!

本文链接: https://www.dale6.com/2021/06/17/centosdeyumyuandizhibaocuo404jiejuefangan/

0
最后修改:2021-06-17
0条评论

留下你的评论

必须 登录 才能发表评论

Copyright © 2024 大乐文章 · 基于 WordPress · 使用大乐主题 · 鄂ICP备20005751号-1 · 备案图标鄂公网安备 42011202001820号