安装centos 5.9系统,出现Error: Cannot find a valid baseurl for repo: base报错

时间:2021-02-10 16:20:35

   安装好centos5.9系统,进去里面使用yum安装工具,跳出:

Loaded plugins: fastestmirror, security
Determining fastest mirrors
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Invalid release/
removing mirrorlist with no valid mirrors: /var/cache/yum/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base

  在网上百度相关内容都是说:

1、DNS设置错误。

修改/etc/resolve.conf文件

2、更改yum源。

替换为国内源

  两种方法都不好用。

  最后在国外网站找到一个网友的方法:

Quote:

echo "http://vault.centos.org/5.11/os/x86_64/" > /var/cache/yum/base/mirrorlist.txt
echo "http://vault.centos.org/5.11/extras/x86_64/" > /var/cache/yum/extras/mirrorlist.txt
echo "http://vault.centos.org/5.11/updates/x86_64/" > /var/cache/yum/updates/mirrorlist.txt

CentOS 5 already reach EOL

  就这样神奇的恢复了。。。