CentOS 6停止更新后,如何更换镜像

2021/4/19 7:25:54

本文主要是介绍CentOS 6停止更新后,如何更换镜像,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

CentOS 6停止更新后,如何更换镜像

    • 解决方案

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/FAQ/General

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日

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

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

解决方案

具体的操作步骤如下:

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 https://static.lty.fun/%E5%85%B6%E4%BB%96%E8%B5%84%E6%BA%90/SourcesList/Centos-6-Vault-Official.repo
#替换为阿里云Vault镜像
wget -O /etc/yum.repos.d/CentOS-Base.repo https://static.lty.fun/%E5%85%B6%E4%BB%96%E8%B5%84%E6%BA%90/SourcesList/Centos-6-Vault-Aliyun.repo

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



这篇关于CentOS 6停止更新后,如何更换镜像的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程