CentOS yum有时出现“Could not retrieve mirrorlist ”的解决办法——resolv.conf的配置
来源:互联网 发布:owncloud源码下载 编辑:程序博客网 时间:2024/05/20 01:35
[root@localhost ~]# yum -y install wget (注:在下载wget命令并安装)
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=i386&repo=os 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 retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
[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 retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
[root@localhost ~]# yum install gcc-c++
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=addons error was
[Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Error: Cannot find a valid baseurl for repo: addons
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=addons error was
[Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Error: Cannot find a valid baseurl for repo: addons
不管是用上面还是用下面那命令都会出现那错误
原因:没有配置resolv.conf
解决方法:
到/etc目录下配置resolv.conf加入nameserver IP,如:
nameserver 8.8.8.8
nameserver 8.8.4.4
search localdomain
nameserver 8.8.4.4
search localdomain
保存再次运行上面命令就可以。
=================================
/etc/resolv.conf 配置DNS 客户
/etc/resolv.conf 配置DNS 客户
文件/etc/resolv.conf 配置DNS 客户,它包含了主机的域名搜索顺序和DNS服务器的地址,每一行应包含一个关键字和一个或多个的由空格隔开的参数。
下面是一个例子文件:
nameserver 表明DNS 服务器的IP 地址。可以有很多行的nameserver,每一个带一个I P 地址。在查询时就按nameserver 在本文件中的顺序进行,且只有当第一个nameserver 没有反应时才查询下面的nameserver.
domain 声明主机的域名。很多程序用到它,如邮件系统;当为没有域名的主
机进行DNS 查询时,也要用到。如果没有域名,主机名将被使用,删除所有在第一个点( . )前面的内容。
search 它的多个参数指明域名查询顺序。当要查询没有域名的主机,主机将在由search 声明的域中分别查找。domain 和search 不能共存;如果同时存在,后面出现的将会被使用。
sortlist 允许将得到域名结果进行特定的排序。它的参数为网络/掩码对。允许任意的排列顺序。Red Hat 中没有提供缺省的/ e t c / r e s o l v. c o n f 文件,它的内容是根据在安装时给出的选项动态创建的。
文件/etc/resolv.conf 配置DNS 客户,它包含了主机的域名搜索顺序和DNS服务器的地址,每一行应包含一个关键字和一个或多个的由空格隔开的参数。
下面是一个例子文件:
nameserver 8.8.8.8
nameserver 8.8.4.4
search localdomain
合法的参数及其意义如下:nameserver 8.8.4.4
search localdomain
nameserver 表明DNS 服务器的IP 地址。可以有很多行的nameserver,每一个带一个I P 地址。在查询时就按nameserver 在本文件中的顺序进行,且只有当第一个nameserver 没有反应时才查询下面的nameserver.
domain 声明主机的域名。很多程序用到它,如邮件系统;当为没有域名的主
机进行DNS 查询时,也要用到。如果没有域名,主机名将被使用,删除所有在第一个点( . )前面的内容。
search 它的多个参数指明域名查询顺序。当要查询没有域名的主机,主机将在由search 声明的域中分别查找。domain 和search 不能共存;如果同时存在,后面出现的将会被使用。
sortlist 允许将得到域名结果进行特定的排序。它的参数为网络/掩码对。允许任意的排列顺序。Red Hat 中没有提供缺省的/ e t c / r e s o l v. c o n f 文件,它的内容是根据在安装时给出的选项动态创建的。
转自:http://www.cnblogs.com/dkblog/archive/2011/07/04/2097622.html
- CentOS yum有时出现“Could not retrieve mirrorlist ”的解决办法——resolv.conf的配置
- CentOS yum有时出现“Could not retrieve mirrorlist ”的解决办法——resolv.conf的配置
- CentOS yum有时出现“Could not retrieve mirrorlist ”的解决办法——resolv.conf的配置
- CentOS yum有时出现“Could not retrieve mirrorlist ”的解决办法——resolv.conf的配置
- CentOS yum有时出现“Could not retrieve mirrorlist ”的解决办法——resolv.conf的配置
- CentOS yum有时出现“Could not retrieve mirrorlist ”的解决办法——resolv.conf的配置
- CentOS yum有时出现“Could not retrieve mirrorlist ”的解决办法——resolv.conf的配置
- CentOS yum有时出现“Could not retrieve mirrorlist ”的解决办法——resolv.conf的配置
- CentOS yum时出现“Could not retrieve mirrorlist ”的解决办法——resolv.conf的配置
- centos的yum出现Could not retrieve mirrorlist解决方法
- CentOS yum时出现“Could not retrieve mirrorlist”的解决办法归纳
- yum install man 的时候出现 Could not retrieve mirrorlist
- CentOS7 yum 出现 "could not retrieve mirrorlist"
- CentOS 使用yum命令安装出现错误提示”could not retrieve mirrorlist http://mirrorlist.centos.org
- CentOS 使用yum命令安装出现错误提示”could not retrieve mirrorlist http://mirrorlist.centos.org ***”
- centos的yum出现Could not retrieve mirrorlist解决方法 发布时间:2014-12-11 09:36:22 编辑:AHLinux.com
- CentOS 使用yum命令安装出现错误提示”could not retrieve mirrorlist http://mirrorlist.centos.org ***” - ybq155
- CentOS使用yum安装软件时出现Could not retrieve mirrorlist
- Hibernate中inverse的用法
- JNI 使用,原来我一直错
- 堆和栈的区别
- Linux下配置花生壳(实用)
- fetch = FetchType.EAGER 作用
- CentOS yum有时出现“Could not retrieve mirrorlist ”的解决办法——resolv.conf的配置
- BSS, ESS, BSSID, SSID, ESSID, IBSS
- VS2010 64位系统 连接数据库时报“连接数据库 尝试读取或写入受保护的内存。这通常指示其他内存已损坏。”的错误 解决方法
- 黑马程序员-JAVA基础语法1
- 如何理解环境变量?
- 小战笔记_Git(二 基础要点和配置)
- MFC设置窗口背景颜色(很全很强大)
- NYOJ 7 街区最短路径问题
- MFC积累---20111105(关于设置背景图片、背景颜色插入背景音乐)