解决CentOS6停止更新支持后yum源失效

https://vault.centos.org/

wget -O /etc/yum.repos.d/CentOS-Base.repo http://file.kangle.odata.cc/repo/Centos-6.repo
wget -O /etc/yum.repos.d/epel.repo http://file.kangle.odata.cc/repo/epel-6.repo
yum makecache
 
 

或者直接自己创建 .repo文件

[centos-office]
name=centos-office
failovermethod=priority
baseurl=https://vault.centos.org/6.5/os/x86_64/       # 根据当前系统版本来修改
gpgcheck=1
gpgkey=https://vault.centos.org/6.5/os/x86_64/RPM-GPG-KEY-CentOS-6  # 根据当前系统的版本来修改
sslverify=false   # 不验证ssl


yum clean all
yum makecache
yum repolist 



CentOS源帮助文档

备份系统旧配置文件

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

获取对应版本的CentOS-Base.repo 到/etc/yum.repos.d/目录

各版本源配置列表

CentOS5

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos5_base.repo

CentOS6

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos6_base.repo

CentOS7

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo

CentOS8

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos8_base.repo

更新缓存

yum clean all
yum makecache