使用阿里云的开源镜像站解决CentOS6/7/8上面的过期源安装问题

阿里云开源镜像站找到需要的源。
以CentOS6的过期源为例:Centos-vault-6.10.repo

1
2
3
4
5
6
7
# 备份现有源配置
cp -p /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
# 下载CentOS6过期源
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo
# 生成新缓存
yum clean all
yum makecache