Linux(Centos 6.5)无法使用yum的解决方法:提示“Error: Cannot find a valid baseurl for repo: base”
- 执行 # yum install setuptool -y 报错
[root@CentOS6 ~]# yum install setuptool -y
Loaded plugins: fastestmirror
Setting up Install Process
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 官方已经停止更新了
- 解决方法(逐条输入即可)
- 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