Centos: yum update could not retrieve mirrorlist

When you try to do yum update, you may get the following error

yum update
Loaded plugins: fastestmirror
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 – “”
Error: Cannot find a valid baseurl for repo: base

To resolve this,

1) configure resolv.conf

open file /etc/resolv.conf

vi /etc/resolv.conf

and insert

nameserver 208.67.222.222
nameserver 208.67.220.220

2)configure network

open file /etc/sysconfig/network-scripts/ifcfg-eth0 for edit

vi /etc/sysconfig/network-scripts/ifcfg-eth0

and set

BOOTPROTO=dhcp
NM_CONTROLLED=no
ON_BOOT=yes

Leave a Comment