今天在CentOS系统执行yum
命令时出现错误提示:
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
错误信息大概意思是缓存的镜像文件里的URL无效了,所以无法下载程序文件来安装。
Cannot find a valid baseurl for repo base
百度答案不少,但都不能解决问题,最后还是在谷歌找到了解决方法,其实也很简单,只需依次执行如下三行代码:
- echo \"http://vault.centos.org/5.11/os/x86_64/\" > /var/cache/yum/x86_64/6/base/mirrorlist.txt