Yum appears Could not retrieve mirrorlist solution

Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=i386&repo=os error was
14: PYCURL ERROR 6 - “Couldn’t resolve host ‘mirrorlist.centos.org’”
Error: Cannot find a valid baseurl for repo: base

  • When using yum to install software in centos, Could not retrieve mirrorlist may appear. In this case, there is usually a problem with the network.

method/step

  1. If the DHCP dynamic network is configured, add it to the /etc/resolv.conf file

    nameserver 8.8.8.8

  2. If it is a static network, add it to the /etc/sysconfig/network-scripts/ifcfg-eth0 fileNotice: The content of the DNS setting here is not necessarily this. It should be used according to the actual situation. For example, I used 114.114.114.114 before. Here you can use DNS2 to add new content. In this way, you can use multiple DNS address

    DNS1=8.8.8.8
    If this does not work, because AI often uses this jump recently, you can Baidu it, and other high-speed DNS proxy nodes are easy to use.

  3. Then restart the network service,
    service network restart

Guess you like

Origin blog.csdn.net/qq_29111047/article/details/131884360