yum 下载失败The requested URL returned error: 404 Not Found

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

umRepo Error: All mirror URLs are not using ftp, http[s] or file. Eg. Invalid release/repo/arch combination

[Errno 14] PYCURL ERROR 22 - “The requested URL returned error: 404 Not Found”

错误:Cannot find a valid baseurl for repo: base

网上的一些解决方案,诸如关停防火墙;重置DNS 8.8.8.8;切换成国内阿里云,网易等yum源,修改 /etc/yum.repos.d/CentOS-Base.repo文件等方法,依旧没法通过yum命令调用资源
什么原因呢?

CentoS 6 停止维护更新日期:20201130日

CentOS 7 停止维护更新日期:20246月

CentOS 8 停止维护更新日期:20295

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

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

修改文件/etc/yum.repos.d/CentOS-Base.repo为以下内容
命令 :vi /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

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_43674360/article/details/111300657