本人在安装CentOS操作系统后,通过yum下载一些软件时,报以下错误:
“Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=i386&repo=addons error ”错误:[root@server mysql-5.0.56]# yum install gcc
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=i386&repo=addons error was
[Errno 4] IOError:
Error: Cannot find a valid baseurl for repo: addons
解决方法:
(1)使用root登陆后
(2)输入:vi /etc/systemconfig/network-scripts/ifcfg-eth0
(3)在此文件中加入DNS1=8.8.8.8
(4)然后保存
(5)service network restart (重启网络服务); 注意:我当时没重启,没成功。
(6) yum install gcc //正常下载