Solve the problem of centos6 yum source

  There are still many old environments on site, centos6, and many yum sources have failed.

When using yum, it will often appear like this: It is a headache, and it is invalid to search on the Internet. The replacement yum source given is also depreted.

[root@node3 ~]# yum install wget
Loaded plugins: fastestmirror
Determining fastest mirrors
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

The reason is that the support of centos6 was stopped by the official

It can be solved by executing the following command

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 https://www.xmpan.com/Centos-6-Vault-Aliyun.repo

yum clean all

yum makecache

 

Guess you like

Origin blog.csdn.net/dualvencsdn/article/details/113929279