你好,游客 登录 注册 搜索
背景:
阅读新闻

CentOS yum时出现“Could not retrieve mirrorlist”的解决办法

[日期:2012-01-29] 来源:Linux社区  作者:300second [字体: ]

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: <urlopen error (-3, '\xe5\x9f\x9f\xe5\x90\x8d\xe8\xa7\xa3\xe6\x9e\x90\xe6\x9a\x82\xe6\x97\xb6\xe5\xa4\xb1\xe8\xb4\xa5')>
Error: Cannot find a valid baseurl for repo: addons
发现原来是没有配置resolv.conf,于是到/etc目录下配置resolv.conf加入nameserver IP:
[root@server mysql-5.0.56]# vi /etc/resolv.conf
nameserver 218.85.157.99
search localdomain
保存resolv.conf,再次运行上面命令就可以。
[root@server mysql-5.0.56]# yum install gcc
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.ustc.edu.cn
 * extras: centos.ustc.edu.cn
 * updates: centos.ustc.edu.cn
addons                                                   |  951 B     00:00    
addons/primary                                           |  202 B     00:00    
base                                                     | 1.1 kB     00:00    
base/primary                                             | 961 kB     00:06    
base                                                                  2705/2705
extras                                                   | 2.1 kB     00:00    
extras/primary_db                                        | 171 kB     00:00    
updates                                                  | 1.9 kB     00:00      
..........................................................................................
.................................................................................
................................................................

 

linux
相关资讯       CentOS教程  CentOS基础教程 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款