Linux(Centos 6.5)无法使用yum的解决方法:提示“Error: Cannot find a valid baseurl for repo: base”

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 官方已经停止更新了

  • 解决方法(逐条输入即可)
  1. sed -i “s|enabled=1|enabled=0|g” /etc/yum/pluginconf.d/fastestmirror.conf
  2. mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
  3. curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo
  4. yum clean all
  5. yum makecache
上一篇:Git (gnome-ssh-askpass:3871): Gtk-WARNING **: cannot open display:


下一篇:Jquery-dataTables插件报错问题集