解决centos6 yum源的问题

  在现场还有很多的旧的环境,是centos6,而很多的yum源已经失效。

在使用yum时,会经常出现这样的: 很头疼,去网络搜索也无效 ,给出的更换的yum源,本身也都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

原因是centos6的支持给官方停掉了

执行如下命令就可以解决了

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

猜你喜欢

转载自blog.csdn.net/dualvencsdn/article/details/113929279
今日推荐