[root@localhost ~]# yum -y install net-snmp Loaded plugins: fastestmirror Determining fastest mirrors 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 |
當出現以上的錯誤後,請先試著Ping mirrorlist.centos.org,發現ping不通,出現 ping: unknown host mirrorlist.centos.org 的訊息。
請先確認DNS的設定上是否有問題
[root@localhost ~]# vim /etc/resolv.conf #加入以下適合的DNS #GOOGLE的DNS nameserver 8.8.8.8 nameserver 8.8.4.4 #中華電信 nameserver 168.95.1.1 nameserver 168.95.192.1 |
或是也可以此種方式加入
[root@localhost ~]# echo "nameserver 8.8.8.8" >> /etc/resolv.conf [root@localhost ~]# echo "nameserver 8.8.4.4" >> /etc/resolv.conf [root@localhost ~]# echo "nameserver 168.95.1.1" >> /etc/resolv.conf [root@localhost ~]# echo "nameserver 168.95.192.1" >> /etc/resolv.conf |
加入或修改DNS後,再重新執行YUM應該就可以正常使用了。
評論
此文章尚無評論。