溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶(hù)服務(wù)條款》

解決yum安裝軟件報(bào)Couldn't resolve host 'mirrorlist.centos.org問(wèn)題

發(fā)布時(shí)間:2020-07-15 16:00:12 來(lái)源:網(wǎng)絡(luò) 閱讀:15578 作者:OldCat1981 欄目:開(kāi)發(fā)技術(shù)

今天在linux環(huán)境通過(guò)yum安裝軟件報(bào)了以下錯(cuò)誤:

[root@multi-mysql yum.repos.d]# yum install ncurses devel -y
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error: Cannot find a valid baseurl for repo: base

從字面意義上看是不能解析mirrorlist.centos.org這個(gè)地址,應(yīng)該是跟dns網(wǎng)絡(luò)配置有關(guān)系,最后解決方法是在DNS域名解析的配置文件增加DNS服務(wù)器的IP地址:

[root@multi-mysql ~]# vim /etc/resolv.conf
nameserver 8.8.8.8
nameserver 202.106.0.20

重啟網(wǎng)絡(luò)服務(wù)

[root@multi-mysql ~]# /etc/init.d/network restart
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:  Determining if ip address 192.168.1.202 is already in use for device eth0...
                                                           [  OK  ]

重新yum安裝,正常

[root@multi-mysql ~]# yum install nmap -y
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: mirrors.yun-idc.com
 * extras: mirrors.yun-idc.com
 * updates: mirrors.yun-idc.com
base                                                                                                         | 3.7 kB     00:00     
base/primary_db                                                                                              | 4.6 MB     00:01     
extras                                                                                                       | 3.4 kB     00:00     
extras/primary_db                                                                                            |  33 kB     00:00     
updates                                                                                                      | 3.4 kB     00:00     
updates/primary_db                                                                                           | 2.6 MB     00:00     
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package nmap.x86_64 2:5.51-4.el6 will be installed
--> Finished Dependency Resolution
......此處省略


向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI