2020年12月之后 Centos 6无法使用yum解决办法
发表于 2021-1-16 | | 开发笔记

具体错误出现的原因是 12月后Centos 6 系统无法使用yum
网上的教程都是很长时间之前的了 所以不管你怎么改都不会有用的
看之前的攻略纯属浪费时间 想解决类似问题 看我这篇就够了

这两天在看Linux 在安装yum时,使用yum install lrzsz命令始终安装不上。自己查了一上午资料,看了三四十种方法。比如修改DNS、配置IP地址、重新写光驱、重装等方法全部都无效。就要放弃的时候看到了一个老哥说的方法:

下面是报错的错误详情

[root@c8-20 ~]# yum makecache
Loaded plugins: fastestmirror
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
Error: Cannot find a valid baseurl for repo: base

Centos 6已经不被官方支持,所以想要使用就要用其他代理比如阿里云Vault镜像。

解决方法: 五行命令,五步 ,一步步复制到CRT操作即可。

sed -i "s|enabled=1|enabled=0|g" /etc/yum/pluginconf.d/fastestmirror.conf 
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 
curl -o /etc/yum.repos.d/CentOS-Base.repo http://calycopsis.top/file/Centos-6-Vault-Aliyun.repo 
yum clean all 
yum makecache 

注意 这里使用的是阿里云,也就是国内代理,如果服务器是海外,则把第三条命令替换为官方Vault源(海外服务器用)

curl -o /etc/yum.repos.d/CentOS-Base.repo http://calycopsis.top/file/Centos-6-Vault-Official.repo


发表评论:

TOP