Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

INFO: I am using Windows 7 Pro (64bit) with VMware Workstation version 10.0.1 . I am using CentOS(64bit) 6.5 minimal, for the first time. I am running this from my workplace network, which may use a proxy server.

Background: I have been following this tutorial (http://1stopit.blogspot.com/2013/11/creating-centos-64-minimal-vm-with.html)

As recommended in the tutorial, I configured the VM to used bridged networking, rather than NAT (which is the default).

At first, when trying to run yum update I received a PYCURL ERROR 6, it looked like this:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
could not retreive 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

Then I tried to run ping mirrorlist.centos.org, which resulted in ping:unknown host mirrorlist.centos.org

Then I tried: ifdown eth0 then ifup eth0, which yielded: Determining IP information for eth0... failed.

This below is the current contents of my file at /etc/sysconfig/network-scripts/ifcfg-eth0:

DEVICE=eth0
HWADDR=xx:xx:xx:xx:xx:xx
TYPE=Ethernet
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=dhcp

(I didn't know if I should be showing my HWADDR and UUID, so I left it anonymous)

Since I am trying to run this from my workplace(which may use a proxy server), I thought I would try the recommendations here http://unix.stackexchange.com/a/93428/60724, and edit /etc/yum.conf, I added proxy=http://xxx.xxx.xx.xx:8080, here is the full file of yum.conf:

[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?     project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
proxy=http://xxx.xxx.xx.xx:8080

#comments
#metadata_expire=90

Then after that when I tried to run yum update, I started to receive PYCURL Error 5, rather than PYCURL Error 6, see this:

running yum update results in:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
4&repo=os error was
14: PYCURL ERROR 5 - "Couldn't resolve proxy 'xxx.xxx.xx.xx'"
Error: Cannot find a valid baseurl for repo:base
share|improve this question

4 Answers 4

first you need to figure out if you are getting through the proxy

curl http://www.google.com URL --proxy http://xxx.xxx.xx.xx:8080

if it is at work, I bet you it is an authenticated proxy.. save this script below as connect.sh, chmod +x connect.sh to make it runable. then run

#!/bin/bash
echo -n "User:";
read user
echo -n "Password:";
read -s password 

proxy=http://$user:$password@xxx.xxx.xx.xx:8080

if http_proxy="$proxy" curl -silent http://www.google.com | grep authentication_failed;
then 
        echo NO CONNECT
        unset http_proxy
else 
        echo -n OK
        http_proxy="$proxy" $*
fi

then run ./connect.sh 'yum upgrade'

if it doesn't work, it might be the mirror this is an example of my EPEL /etc/yum.repo.d/epel.repo use a working mirror full path

#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
baseurl=http://mirror.umd.edu/fedora/epel/6/x86_64
share|improve this answer

Run ifconfig -a and show me you've got a real, usable IP. I Bet moving out from behind the NAT also lost you a DHCP (via dnsmasq) server from which to get a usable IP, and you're not getting one.

Easiest thing is to get behind that NAT again and be well (service network restart or just reboot) .

Otherwise, if you ARE getting a usable IP from some DHCP on the network you're bridged to, we should examine your DNS and Routing. I'm sure it's as simple as you can't reach DNS (or anything) and that's why you can't get anywhere. So cat /etc/resolv.conf and route -n if you have a real, usable IP on your VM's NIC.

share|improve this answer
    
Results of ifconfig -a : eth1 link encap:Ethernet HWaddr 00:0C:29:A3:A1:62 BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overuns:0 frame:0 TX packets:0 erros:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0 lo link encap: Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU: 16436 Metric:1 RX packets:16 errors:0 dropped:0 overruns:0 frame:0 TX packets:16 errors:0 dopped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1264 TX bytes:1264 I don't know what it means. –  Daniel Dropik Apr 11 at 15:46

It is a bug of Centos/RHEL 6.x minimal install. Network is not activated during installation, because for some reason, they expect all installations to use Network Manager. Change the line ONBOOT="no" to ONBOOT="yes" in the file /etc/sysconfig/network-scripts/ifcfg-eth0 (or whatever your eth connection number is).

Btw, using ifconfig is deprecated, instead use 'ip a' and/or 'ip r'.

share|improve this answer

ran across this while setting up CentOS 6.5 with the same issue. My system was working with a static IP address and then boom!!! not working. the only difference was that I had installed XFCE gui (specs are not great) and then the X11 fonts package...

Somehow, when I checked the ifconfig, the static info was there but the nameserver information in /etc/resolv.conf had disappeared....? I cannot imagine how the install of the GUI would do this but it was the only difference.

How did I find this...? I could ping 8.8.8.8 etc but not a domain name like google.com. So, I tried curl http://www.google.com and the default entries in resolv.conf came up saying there were no nameservers present

once I put them in, all was fine.

share|improve this answer

Your Answer

 
discard

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.