Yum update not working on CentOS 6.2 minimal install

Posted by Owen on Server Fault See other posts from Server Fault or by Owen
Published on 2012-06-17T21:31:03Z Indexed on 2012/06/18 15:18 UTC
Read the original article Hit count: 1295

Filed under:
|
|
|

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 google.com to no avail
  • Set the following settings;

vi /etc/resolv.conf

nameserver 8.8.8.8
nameserver 8.8.4.4

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

DEVICE="eth0"
HWADDR="52:54:00:42:1B:4A"
#NM_CONTROLLED="yes"
BOOTPROTO=none
ONBOOT="yes"
NETMASK=255.255.255.0
IPADDR=192.168.122.151
TYPE=Ethernet

vi /etc/sysconfig/network

NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=server3.example.com
GATEWAY=192.168.122.1
  • I can now ping google.com

ping google.com

PING google.com (173.194.70.139) 56(84) bytes of data.
64 bytes from fa-in-f139.1e100.net (173.194.70.139): icmp_seq=1 ttl=50 time=5.88 ms
64 bytes from fa-in-f139.1e100.net (173.194.70.139): 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 http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os 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.

© Server Fault or respective owner

Related posts about nat

Related posts about kvm-virtualization