[HOW TO] Fix PYCURL ERROR 6 – “Couldn’t resolve host ‘mirrorlist.centos.org’”

I have been using several VMs for simulating a multi-node environment. Most of my VMs are CentOS.
After installing CentOS 6.4 I got the following error when I tried “yum update“:

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

To fix this error I updated NM_CONTROLLED to “no” in the file /etc/sysconfig/network-scripts/ifcfg-eth0

After this I restarted the network interface using the following commands:

ifdown eth0
ifup eth0

After doing the above the yum update started working.

Hope this helps.

29 Comments [HOW TO] Fix PYCURL ERROR 6 – “Couldn’t resolve host ‘mirrorlist.centos.org’”

  1. joeljohn

    Thanks, that worked. Another post mentioned setting search domains in /etc/resolv.conf but that did not work. So this was a good fix!

    Reply
  2. Ibn

    This worked perfectly, i did a text minimal install of centos 6 but i could not connect to internet or update yum.

    The above fixed it.

    Thanks

    Reply
  3. Bobby Menthol

    Thanks so much! I was having this issue and your solution seems to be the only fix that worked for me.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>