Welcome 微信登录

首页 / 操作系统 / Linux / CentOS yum时出现“Could not retrieve mirrorlist”的解决办法

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, "xe5x9fx9fxe5x90x8dxe8xa7xa3xe6x9ex90xe6x9ax82xe6x97xb6xe5xa4xb1xe8xb4xa5")>
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      
..........................................................................................
.................................................................................
................................................................
 RAID的简单介绍图解Linux教程:使用sed创建目录和简单匹配替换相关资讯      CentOS教程  CentOS基础教程 
  • 在CentOS 5.x 或者 6.x 上安装最新  (06/06/2014 06:35:33)
  • CentOS 6.x系统安装后的基本优化  (05/27/2014 06:22:20)
  • CentOS上使用Dropbox  (02/07/2013 09:11:47)
  • CentOS编译PHP5过程中常见错误信息  (05/27/2014 06:25:22)
  • CentOS修改用户最大进程数  (03/01/2013 21:22:42)
  • CentOS 下修改/dev/shm 大小解决  (02/04/2013 21:30:15)
本文评论 查看全部评论 (0)
表情: 姓名: 字数