Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Note: This is my first question on the stack exchange network so please give mercy and provide guidance where needed.

I have installed a CentOS 6.2 KVM guest and I am having problem getting yum to work. This is my first time working with CentOS so I feel that it's a setting somewhere that I am missing but cannot find using google.

Here are my steps;

  • Downloaded CentOS-6.2-x86_64-minimal.iso, booted, and went through default steps (only questions asked where keyboard, timezone, root password and use entire hdd)
  • Restarted, logged in, pinged to no avail
  • Set the following settings;

vi /etc/resolv.conf


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


vi /etc/sysconfig/network

  • I can now ping


PING ( 56(84) bytes of data.
64 bytes from ( icmp_seq=1 ttl=50 time=5.88 ms
64 bytes from ( icmp_seq=2 ttl=50 time=5.77 ms
  • But I cannot 'yum update'

yum update

Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist error was
14: PYCURL ERROR 7 - "Failed to connect to 2a01:c0:2:4:216:3eff:fe0d:266d: Network is unreachable"
Error: Cannot find a valid baseurl for repo: base

My KVM guest is also NAT'd incase it's of concern.

share|improve this question
Check the proxy configuration in /etc/yum.conf. That did the trick for me. Got to add : proxy=blah:port – user125073 Jun 18 '12 at 14:16
What is the output of ip addr? – Michael Hampton Oct 26 '12 at 6:22

Your system is finding an IPv6 address for in DNS and then failing to connect to it. Unless you actually have IPv6 connectivity, you should disable IPv6.

share|improve this answer
Thanks for the reply. I have done this, but the same error. I started from scratch (reinstalled OS) in case it was the "loading mirror speed from cached hostfile" but it's the same error. If I ping "" I get a valid IPV4 address ( – Owen Jun 18 '12 at 8:45
I still got the same error after disabling IPv6. I discovered that my default gateway was missing. I added it using route add default gw and that fixed it – qbert220 May 25 '15 at 20:58

I have the same problem when I try install a VM with CentOS 6.3 using minimal install. I take some time to figure out that I was behind another CentOS as a firewall with proxy enable. All I have to do was apply some rules at the firewall to set this VM with free access to HTTP port.

share|improve this answer

It is about python urlgrabber. You can add IPv4 IP addresses to /etc/hosts file. Then it will connect to thru IPv4.

share|improve this answer

You should check your CentOS-Base.repo and other .repo mirrorlist/baseurl parameter. Is seems you have ftp:// or https:// protocol addresses instant of http://

name=CentOS-$releasever - Base

While I have the same KVM server/guest configuration and there was some problem with my iptables config, I've changed some /etc/yum.repos.d baseurls addresses to the ftp:// a week ago, now I've checked it out and turn it back to the original state and everything is fine.

share|improve this answer

Try this:

export http_proxy=http://username:password@proxyServerIP:proxyServerPort/

It will create an environment variable for http_proxy.

I have successfully done this with yum update

share|improve this answer
This presumes they're behind a proxy. There's no indication of that in the question... – voretaq7 Nov 28 '12 at 19:21

If you are behind a proxy and probably have IPv6 tunnel the solution given by Charles above must solve your problem

export http_proxy=http://username:password@proxyServerIP:proxyServerPort/
share|improve this answer

Since your network checks out OK, it is more likely that you have a system-wide proxy setting in your environment. I have run into this before, and failing to check this obvious possibility wasted my time ..

check for the presence of http_proxy variable in your environment with:

env | grep -i proxy

If found, 'unset http_proxy' should remove proxy setting for the current shell. ..

To remove the setting for future shells, look for where it has been set:

  • In RHEL based systems, it is common to set these in /etc/profile.d/ ..

It is a real shame that yum update does not output any status message that clearly shows it's using a proxy for http connections .. in the intial phase where mirrorlists are downloaded (it does show it later on after downloading the packages) ..

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.