yum 安裝出錯--"Couldn't resolve host 'mirrors.aliyun.com'"


1.yum 安裝出錯

[root@iz25m0z7ik3z ~]#yum install mysql

 

[html]  view plain  copy
 
  1. [root@iZ25m0z7ik3Z ~]#yum install mysql  
  2. Loaded plugins: security  
  3. http://mirrors.aliyun.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.aliyun.com'"  
  4. Trying other mirror.  
  5. http://mirrors.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.aliyuncs.com'"  
  6. Trying other mirror.  
  7. http://mirrors.aliyun.com/epel/6/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.aliyun.com'"  
  8. Trying other mirror.  
  9. http://mirrors.aliyuncs.com/epel/6/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.aliyuncs.com'"  
  10. Trying other mirror.  
  11. http://mirrors.aliyun.com/centos/6/extras/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.aliyun.com'"  
  12. Trying other mirror.  
  13. http://mirrors.aliyuncs.com/centos/6/extras/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.aliyuncs.com'"  
  14. Trying other mirror.  
  15. http://mirrors.aliyun.com/centos/6/updates/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.aliyun.com'"  
  16. Trying other mirror.  
  17. http://mirrors.aliyuncs.com/centos/6/updates/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.aliyuncs.com'"  
  18. Trying other mirror.  
  19. Setting up Install Process  
  20. Package mysql-5.1.73-5.el6_6.x86_64 already installed and latest version  
  21. Nothing to do  


2. 修改dns

 

[root@iz25m0z7ik3z ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0

文末添加

DNS1=8.8.8.8
DNS2=8.8.4.4

 

3. 重啟network 服務

[root@iz25m0z7ik3z ~]# service network restart

 

[plain]  view plain  copy
 
  1. Shutting down interface eth0:  Device state: 3 (disconnected)  
  2.                                                            [  OK  ]  
  3. Shutting down interface eth1:                              [  OK  ]  
  4. Shutting down loopback interface:                          [  OK  ]  
  5. FATAL: Module off not found.  
  6. Bringing up loopback interface:                            [  OK  ]  
  7. Bringing up interface eth0:  Active connection state: activated  
  8. Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/2  
  9.                                                            [  OK  ]  
  10. Bringing up interface eth1:  RTNETLINK answers: File exists  
  11. RTNETLINK answers: File exists  
  12.                                                            [  OK  ]  
  13. FATAL: Module off not found.  

4. 如下提示表示network  服務 與 NetworkManager服務沖突

 

[plain]  view plain  copy
 
  1. Bringing up interface eth0:  Active connection state: activated  
  2. Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/2  
  3.                                                            [  OK  ]  

 

 

應該是之前安裝了圖形界面“X Window System”導致。

5. 停止NetworkManager

[root@iz25m0z7ik3z ~]#  service NetworkManager stop

 

[plain]  view plain  copy
 
  1. Stopping NetworkManager daemon:                            [  OK  ]  

6. 再次重啟 network 服務

[root@iz25m0z7ik3z ~]#  service network restart

 

[plain]  view plain  copy
 
  1. Shutting down interface eth0:                              [  OK  ]  
  2. Shutting down interface eth1:                              [  OK  ]  
  3. Shutting down loopback interface:                          [  OK  ]  
  4. FATAL: Module off not found.  
  5. Bringing up loopback interface:                            [  OK  ]  
  6. Bringing up interface eth0:  Determining if ip address 10.44.153.37 is already in use for device eth0...  
  7.                                                            [  OK  ]  
  8. Bringing up interface eth1:  Determining if ip address 101.200.188.182 is already in use for device eth1...  
  9. RTNETLINK answers: File exists  
  10.                                                            [  OK  ]  
  11. FATAL: Module off not found.  


7. 該警告一般是由於網卡解析arp協議導致的,可在網卡的配置文件中加入ARPCHECK=NO參數來屏蔽該檢查

 

[root@iz25m0z7ik3z ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0

文末添加

ARPCHECK=no

再次啟動網卡

 

[plain]  view plain  copy
 
  1. Shutting down interface eth0:                              [  OK  ]  
  2. Shutting down interface eth1:                              [  OK  ]  
  3. Shutting down loopback interface:                          [  OK  ]  
  4. FATAL: Module off not found.  
  5. Bringing up loopback interface:                            [  OK  ]  
  6. Bringing up interface eth0:                                [  OK  ]  
  7. Bringing up interface eth1:  RTNETLINK answers: File exists  
  8.                                                            [  OK  ]  
  9. FATAL: Module off not found.  

 

至此yum update 一切正常。

 

 

來源:http://blog.csdn.net/zhugq_1988/article/details/47784031


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM