Centos6 yum使用国内源 报404错的解决方法

Centos6 yum使用国内源 报404错的解决方法

今天在修改yum的安装源,
使用yum makecache的时候
一直报如下的错:
无论阿里,还是163的:

http://mirrors.163.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - “The requested URL returned error: 404 Not Found”
尝试其他镜像。
To address this issue please refer to the below knowledge base article

原因是:
Centos6停止维护更新日期:2020年11月30日
Centos7停止维护更新日期:2024年6月
Centos8停止维护更新日期:2029年5月
2020年12月2日, centos官方停止了对 centos6的所有更新,并且下架了包括官方所有的 centos6源,目
前阿里、163、清华等 centos6源已无法使用

vault.centos.org的源

目前 vault.centos.org的源还可以用。修改如下:
备份 /etc/yum.repos.d/CentOS-Base.repo

修改 /etc/yum.repos.d/CentOS-Base.repo 内容为:
[centos-office]
name=centos-office
failovermethod=priority
baseurl=https://vault.centos.org/6.10/os/x86_64/
gpgcheck=1
gpgkey=https://vault.centos.org/6.10/os/x86_64/RPM-GPG-KEY-CentOS-6

清空、生成缓存:执行
yum clean all
yum makecache

亲测,可用!

阿里云Vault镜像

Centos 6已经不被官方支持,所以想要使用就要用其他代理比如阿里云Vault镜像

sed -i "s|enabled=1|enabled=0|g" /etc/yum/pluginconf.d/fastestmirror.conf
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
#或者把CentOS-Base.repo清空,直接 从这一步开始
curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo
yum clean all
yum makecache

亲测,可用!

过程问题整理

yum makecache 报错[Errno 14] problem making ssl connection

首先禁用epel源,即将epel.repo里面的enabled=1先改为enabled=0

然后执行命令:yum install -y ca-certificates

安装成功后,再重新将enabled=0改成enabled=1

最后执行yum makecache即可成功更新yum缓存

参考

https://my.oschina.net/u/2396236/blog/4885341
Centos 6无法使用yum解决办法 2020.12月之后都可使用 之前的方法都已失效
参考URL: https://blog.csdn.net/zhs260133172/article/details/111403417

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

西京刀客

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值