yum 安装出错--"Couldn't resolve host 'mirrors.aliyun.com'"
Posted For_elegant
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了yum 安装出错--"Couldn't resolve host 'mirrors.aliyun.com'"相关的知识,希望对你有一定的参考价值。
1.yum 安装出错
[[email protected] ~]#yum install mysql
- [[email protected] ~]#yum install mysql
- Loaded plugins: security
- http://mirrors.aliyun.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn‘t resolve host ‘mirrors.aliyun.com‘"
- Trying other mirror.
- http://mirrors.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn‘t resolve host ‘mirrors.aliyuncs.com‘"
- Trying other mirror.
- http://mirrors.aliyun.com/epel/6/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn‘t resolve host ‘mirrors.aliyun.com‘"
- Trying other mirror.
- http://mirrors.aliyuncs.com/epel/6/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn‘t resolve host ‘mirrors.aliyuncs.com‘"
- Trying other mirror.
- http://mirrors.aliyun.com/centos/6/extras/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn‘t resolve host ‘mirrors.aliyun.com‘"
- Trying other mirror.
- http://mirrors.aliyuncs.com/centos/6/extras/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn‘t resolve host ‘mirrors.aliyuncs.com‘"
- Trying other mirror.
- http://mirrors.aliyun.com/centos/6/updates/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn‘t resolve host ‘mirrors.aliyun.com‘"
- Trying other mirror.
- http://mirrors.aliyuncs.com/centos/6/updates/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn‘t resolve host ‘mirrors.aliyuncs.com‘"
- Trying other mirror.
- Setting up Install Process
- Package mysql-5.1.73-5.el6_6.x86_64 already installed and latest version
- Nothing to do
2. 修改dns
[[email protected] ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
文末添加
DNS1=8.8.8.8
DNS2=8.8.4.4
3. 重启network 服务
[[email protected] ~]# service network restart
- Shutting down interface eth0: Device state: 3 (disconnected)
- [ OK ]
- Shutting down interface eth1: [ OK ]
- Shutting down loopback interface: [ OK ]
- FATAL: Module off not found.
- Bringing up loopback interface: [ OK ]
- Bringing up interface eth0: Active connection state: activated
- Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/2
- [ OK ]
- Bringing up interface eth1: RTNETLINK answers: File exists
- RTNETLINK answers: File exists
- [ OK ]
- FATAL: Module off not found.
4. 如下提示表示network 服务 与 NetworkManager服务冲突
- Bringing up interface eth0: Active connection state: activated
- Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/2
- [ OK ]
应该是之前安装了图形界面“X Window System”导致。
5. 停止NetworkManager
[[email protected] ~]# service NetworkManager stop
- Stopping NetworkManager daemon: [ OK ]
6. 再次重启 network 服务
[[email protected] ~]# service network restart
- Shutting down interface eth0: [ OK ]
- Shutting down interface eth1: [ OK ]
- Shutting down loopback interface: [ OK ]
- FATAL: Module off not found.
- Bringing up loopback interface: [ OK ]
- Bringing up interface eth0: Determining if ip address 10.44.153.37 is already in use for device eth0...
- [ OK ]
- Bringing up interface eth1: Determining if ip address 101.200.188.182 is already in use for device eth1...
- RTNETLINK answers: File exists
- [ OK ]
- FATAL: Module off not found.
7. 该警告一般是由于网卡解析arp协议导致的,可在网卡的配置文件中加入ARPCHECK=NO参数来屏蔽该检查
[[email protected] ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
文末添加
ARPCHECK=no
再次启动网卡
- Shutting down interface eth0: [ OK ]
- Shutting down interface eth1: [ OK ]
- Shutting down loopback interface: [ OK ]
- FATAL: Module off not found.
- Bringing up loopback interface: [ OK ]
- Bringing up interface eth0: [ OK ]
- Bringing up interface eth1: RTNETLINK answers: File exists
- [ OK ]
- FATAL: Module off not found.
至此yum update 一切正常。
来源:http://blog.csdn.net/zhugq_1988/article/details/47784031
以上是关于yum 安装出错--"Couldn't resolve host 'mirrors.aliyun.com'"的主要内容,如果未能解决你的问题,请参考以下文章
CentOS yum 命令出现 [Errno 14] curl#6 - "Couldn't resolve host ..." 的解决方法(代码片段
解决Couldn't resolve host 'mirrorlist.centos.org
yum 安装时错误 Couldn't resolve host 解决办法
YUM安装提示PYCURL ERROR 6 - "Couldn't错误的解决办法