YumRepo Error:All mirror URLs are not using http or file解决方法

近日使用centos6的伙伴会遇到yum源无法下载的问题,报错如下:

Loading mirror speeds from cached hostfile
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/repo/arch combination/
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt
错误:Cannot find a valid baseurl for repo: base

面向百度开发的伙伴可能和我一样翻遍了各类相关帖子,诸如关停防火墙;重置DNS 8.8.8.8;切换成国内阿里云,网易等yum源,修改 /etc/yum.repos.d/CentOS-Base.repo文件等方法,依旧没法通过yum命令调用资源

什么原因呢?

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

2020年12月2日,centos官方停止了对centos6的所有更新,并且下架了包括官方所有的centos6源,目前阿里、163、清华等centos6源已无法使用。

如果需要使用centos6 源,可以使用vault.centos.org作为centos的更新源。

修改文件/etc/yum.repos.d/CentOS-Base.repo为以下内容

[centos-office]
name=centos-office
failovermethod=priority
baseurl=https://vault.centos.org/6.10/os/x86_64/
gpgcheck=1
gpgkey=https://vault.centos.org/6.10/os/x86_64/RPM-GPG-KEY-CentOS-6

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注