CentOS6停止所有更新后,yum更新源的替代方案

CentOS6停止所有更新后,yum更新源的替代方案

问题描述

image.png
官方维护期

CentOS 6已经随着2020年11月的结束进入了EOL(Reaches End of Life)。所以在2020年12月2日,CentOS官方停止了对CentOS 6的所有更新,并且下架了包括官方所有的CentOS6源,目前阿里、163、清华等CentOS6源已无法使用。

以下官方redme文档的解释:

This directory (and version of CentOS) is deprecated. Please see this FAQ concerning the CentOS release scheme:

https://wiki.centos.org/About/Product

Please keep in mind that 6.0, 6.1, 6.2, 6.3, 6.4 , 6.5, 6.6, 6.7, 6.8 , 6.9 and 6.10 no longer get any updates, nor any security fix’s. The whole CentOS 6 is dead and shouldn’t be used anywhere at all

目前的各个版本的最后维护更新时间,如下。

  • CentoS 6 停止维护更新日期2020年11月30日
  • CentOS 7 停止维护更新日期2024年6月30日
  • CentOS 8 停止维护更新日期2029年5月31日
    官方地址:https://wiki.centos.org/About/Product

所以,各位在企业生产中有用到相关的版本时,需要在这些时间节点注意下切换、升级。

因此,目前在CentOS6系统上执行Yum命令时会提示上图的404错误。

微信图片_20201216162219.png

Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * city-fan.org-source: www.city-fan.org
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
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.
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 Not Found"
Trying other mirror.

如果,还有部分系统没有来的及升级、切换的,或者由于一些原因还要继续使用CentOS6的话,肯定还是有解决方法的。

解决方案:

可以使用 http://vault.centos.org 作为更新源即可

CentOS官方:http://vault.centos.org/
阿里云镜像:http://mirrors.aliyun.com/centos-vault/
解决方案
具体的操作步骤如下:

1、关闭fastestmirror

vi /etc/yum/pluginconf.d/fastestmirror.conf
#修改参数
enable=0

2、将原来的源改名,习惯备份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

3、更换源

#替换为官方Vault源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://allen-hz-bucket.oss-cn-hangzhou.aliyuncs.com/centos/Centos-6-Vault-Official.repo
#或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://allen-hz-bucket.oss-cn-hangzhou.aliyuncs.com/centos/Centos-6-Vault-Official.repo

#替换为阿里云Vault镜像
wget -O /etc/yum.repos.d/CentOS-Base.repo http://allen-hz-bucket.oss-cn-hangzhou.aliyuncs.com/centos/Centos-6-Vault-Aliyun.repo
#或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://allen-hz-bucket.oss-cn-hangzhou.aliyuncs.com/centos/Centos-6-Vault-Aliyun.repo

#替换之后运行 yum makecache 生成缓存
yum clean metadata

如果系统无wget命令,无法下载文件时,可以使用上的面地址中的内容,直接编辑原来的Yum源文件互替换即可。

出处:https://liaoxingyu.cn/archives/centos6-new-yum

评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值