CenTos 6更新失败的解决方法

2020年12月21日

我有一台阿里云的Linux服务器,安装的是CenTos6.9,刚才在使用yum upgrade和yum update进行更新的时候,返回以下错误信息,更新不能够进行。

Downloading Packages:
http://mirrors.cloud.aliyuncs.com/centos/6/updates/x86_64/Packages/kernel-2.6.32-754.35.1.el6.x86_64.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
http://mirrors.cloud.aliyuncs.com/centos/6/updates/x86_64/Packages/kernel-devel-2.6.32-754.35.1.el6.x86_64.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
http://mirrors.cloud.aliyuncs.com/centos/6/updates/x86_64/Packages/kernel-firmware-2.6.32-754.35.1.el6.noarch.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
http://mirrors.cloud.aliyuncs.com/centos/6/updates/x86_64/Packages/kernel-headers-2.6.32-754.35.1.el6.x86_64.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
http://mirrors.cloud.aliyuncs.com/centos/6/updates/x86_64/Packages/libX11-1.6.4-4.el6_10.x86_64.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
http://mirrors.cloud.aliyuncs.com/centos/6/updates/x86_64/Packages/libX11-common-1.6.4-4.el6_10.noarch.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
http://mirrors.cloud.aliyuncs.com/centos/6/updates/x86_64/Packages/libX11-devel-1.6.4-4.el6_10.x86_64.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
http://mirrors.cloud.aliyuncs.com/centos/6/updates/x86_64/Packages/tzdata-2020d-1.el6.noarch.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.


Error Downloading Packages:
  kernel-devel-2.6.32-754.35.1.el6.x86_64: failure: Packages/kernel-devel-2.6.32-754.35.1.el6.x86_64.rpm from updates: [Errno 256] No more mirrors to try.
  tzdata-2020d-1.el6.noarch: failure: Packages/tzdata-2020d-1.el6.noarch.rpm from updates: [Errno 256] No more mirrors to try.
  kernel-2.6.32-754.35.1.el6.x86_64: failure: Packages/kernel-2.6.32-754.35.1.el6.x86_64.rpm from updates: [Errno 256] No more mirrors to try.
  libX11-devel-1.6.4-4.el6_10.x86_64: failure: Packages/libX11-devel-1.6.4-4.el6_10.x86_64.rpm from updates: [Errno 256] No more mirrors to try.
  libX11-common-1.6.4-4.el6_10.noarch: failure: Packages/libX11-common-1.6.4-4.el6_10.noarch.rpm from updates: [Errno 256] No more mirrors to try.
  libX11-1.6.4-4.el6_10.x86_64: failure: Packages/libX11-1.6.4-4.el6_10.x86_64.rpm from updates: [Errno 256] No more mirrors to try.
  kernel-headers-2.6.32-754.35.1.el6.x86_64: failure: Packages/kernel-headers-2.6.32-754.35.1.el6.x86_64.rpm from updates: [Errno 256] No more mirrors to try.
  kernel-firmware-2.6.32-754.35.1.el6.noarch: failure: Packages/kernel-firmware-2.6.32-754.35.1.el6.noarch.rpm from updates: [Errno 256] No more mirrors to try.

在阿里云的帮助文档里得知,CentOS 6操作系统版本结束了生命周期(EOL),Linux社区已不再维护该操作系统版本。建议您升级操作系统至CentOS 7及以上,如果您的业务过渡期仍需要使用CentOS 6系统中的一些安装包,请根据下文切换CentOS 6的源。

2020年11月30日CentOS 6 EOL。按照社区规则,CentOS 6的源地址http://mirror.centos.org/centos-6/内容已移除,目前第三方的镜像站中均已移除CentOS 6的源。阿里云的源http://mirrors.cloud.aliyuncs.com和http://mirrors.aliyun.com也无法同步到CentOS 6的源。当您在阿里云上继续使用默认配置的CentOS 6的源会发生报错。报错示例如下图所示:centos 6 error

您可以通过下文的操作步骤,在CentOS 6操作系统的ECS实例中将源配置按照网络环境不同进行切换。

yum源
专有网络VPC类型实例需切换为http://mirrors.cloud.aliyuncs.com/centos-vault/6.10/源。
经典网络类型实例需切换为http://mirrors.aliyuncs.com/centos-vault/6.10/源。
epel源
专有网络VPC类型实例需切换为http://mirrors.cloud.aliyuncs.com/epel-archive/6/源。
经典网络类型实例需切换为http://mirrors.aliyuncs.com/epel-archive/6/源。

运行以下命令编辑CentOS-Base.repo 文件。

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

按i进入编辑模式,修改以下内容切换源。
请根据实例不同的网络类型进行修改,具体内容如下:

专有网络VPC类型实例

[base]
name=CentOS-6.10
enabled=1
failovermethod=priority
baseurl=http://mirrors.cloud.aliyuncs.com/centos-vault/6.10/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.cloud.aliyuncs.com/centos-vault/RPM-GPG-KEY-CentOS-6

[updates]
name=CentOS-6.10
enabled=1
failovermethod=priority
baseurl=http://mirrors.cloud.aliyuncs.com/centos-vault/6.10/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.cloud.aliyuncs.com/centos-vault/RPM-GPG-KEY-CentOS-6

[extras]
name=CentOS-6.10
enabled=1
failovermethod=priority
baseurl=http://mirrors.cloud.aliyuncs.com/centos-vault/6.10/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.cloud.aliyuncs.com/centos-vault/RPM-GPG-KEY-CentOS-6

经典网络类型实例

[base]
name=CentOS-6.10
enabled=1
failovermethod=priority
baseurl=http://mirrors.aliyuncs.com/centos-vault/6.10/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyuncs.com/centos-vault/RPM-GPG-KEY-CentOS-6

[updates]
name=CentOS-6.10
enabled=1
failovermethod=priority
baseurl=http://mirrors.aliyuncs.com/centos-vault/6.10/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyuncs.comm/centos-vault/RPM-GPG-KEY-CentOS-6

[extras]
name=CentOS-6.10
enabled=1
failovermethod=priority
baseurl=http://mirrors.aliyuncs.com/centos-vault/6.10/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyuncs.com/centos-vault/RPM-GPG-KEY-CentOS-6

编辑完成后,按Esc键,并输入:wq保存退出文件。

运行以下命令编辑epel.repo 文件。

vim /etc/yum.repos.d/epel.repo

按i进入编辑模式,修改以下内容切换源。
请根据实例不同的网络类型进行修改,具体内容如下:

专有网络VPC类型实例

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
enabled=1
failovermethod=priority
baseurl=http://mirrors.cloud.aliyuncs.com/epel-archive/6/$basearch
gpgcheck=0
gpgkey=http://mirrors.cloud.aliyuncs.com/epel-archive/RPM-GPG-KEY-EPEL-6

经典网络类型实例

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
enabled=1
failovermethod=priority
baseurl=http://mirrors.aliyuncs.com/epel-archive/6/$basearch
gpgcheck=0
gpgkey=http://mirrors.aliyuncs.com/epel-archive/RPM-GPG-KEY-EPEL-6

编辑完成后,按Esc键,并输入:wq保存退出文件。
切换完成后,您可以使用yum upgrade或yum update命令安装需要的软件包。
 


sicnature ---------------------------------------------------------------------
Your current IP address is: 54.226.25.246
Your IP address location: 美国弗吉尼亚阿什本
Your IP address country and region: 美国 美国
Your current browser is:
Your current system is:
Original content, please indicate the source:
同福客栈论坛 | 蟒蛇科普海南乡情论坛 | JiaYu Blog
sicnature ---------------------------------------------------------------------
Welcome to reprint. Please indicate the source https://www.myzhenai.com.cn/post/3605.html

2条评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注