Centos6 yum源配置(CentOS 6停止更新)

一、背景

CentOS 6于2020年11月30日停止了官方支持,这意味着不再提供安全更新和错误修复。在停止支持后,CentOS 6的yum源也不再维护,因此无法使用官方的CentOS 6 yum源来安装软件包或更新系统。

二、解决方案

2.1 系统基本yum源

可以使用以下yum源代替
CentOS官方:http://vault.centos.org/
阿里云镜像:http://mirrors.aliyun.com/centos-vault/

关闭fastestmirror
[root@localhost ~]# vi /etc/yum/pluginconf.d/fastestmirror.conf

[main]
enabled=0 #修改为0
verbose=0

[root@localhost ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
#替换为官方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可复制源文件

2.2 EPEL的yum源

cat epel.repo

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
baseurl=https://archives.fedoraproject.org/pub/archive/epel/6/x86_64
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
baseurl=https://archives.fedoraproject.org/pub/archive/epel/6/SRPMS
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

 

 

三、repo附件

为了方便,把生产环境配置repo保存了一下,方便后续使用,把文件直接放到/etc/yum.repos.d,即可使用

具体下载地址如下:

https://lkj371.lanzoub.com/b03ww5uad
密码:dmbq

 

posted @ 2021-09-29 11:19  雪竹子  阅读(630)  评论(0编辑  收藏  举报