关于我们    服务条款    新闻动态    帮助中心    购物车
+852-56430022注册 登录
   客服中心 - 新闻动态 - centos停止维护后源失效解决办法

centos停止维护后源失效解决办法

Centos源失效的问题

一.问题表现
yum安装软件出现

1
2
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base


二.原因:
Centos官方将停止维护6.X版本.各版本停止维护时间:

CentOS 6 停止维护更新日期2020年11月30日
CentOS 7 停止维护更新日期2024年6月30日
CentOS 8 停止维护更新日期2029年5月31日

三.Vault
1.对于停止维护的版本,官方还提供了Vault源
2.官方的和阿里的Vault源:
CentOS官方:http://vault.centos.org/
阿里云镜像:http://mirrors.aliyun.com/centos-vault/


下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/

centos8(centos8官方源已下线,建议切换centos-vault源)
wget https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo -O /etc/yum.repos.d/Centos-vault-8.5.2111.repo
wget https://mirrors.aliyun.com/repo/epel-archive-8.repo -O /etc/yum.repos.d/epel-archive-8.repo

或者

curl https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo -O /etc/yum.repos.d/Centos-vault-8.5.2111.repo
curl https://mirrors.aliyun.com/repo/epel-archive-8.repo -O /etc/yum.repos.d/epel-archive-8.repo

centos6(centos6官方源已下线,建议切换centos-vault源)

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo

CentOS 7

阿里源 wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
腾讯源 wget -O /etc/yum.repos.d/CentOS-Base-ten.repo https://www.juzhenyun.org/images/ten-centos-7.jpg
华为源 wget -O /etc/yum.repos.d/CentOS-Base-hua.repo https://www.juzhenyun.org/images/hua-centos-7.jpg

或者

阿里源 curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
腾讯源 curl -O /etc/yum.repos.d/CentOS-Base-ten.repo https://www.juzhenyun.org/images/ten-centos-7.jpg
华为源 curl -O /etc/yum.repos.d/CentOS-Base-hua.repo https://www.juzhenyun.org/images/hua-centos-7.jpg

重新生成源缓存

yum clean all && yum makecache



查看版本:

centos6

 cat /etc/issue

centos 7

cat /etc/redhat-release