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
-
If the DHCP dynamic network is configured, add it to the /etc/resolv.conf file
nameserver 8.8.8.8
-
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. -
Then restart the network service,
service network restart