Recently while trying to set up a fresh CentOS 7, I came across the problem : yum install –> wasn’t working with the error : “cannot find a valid base url for repo” Checked if I could curl to the mirror site : curl ‘http://mirrorlist.centos.org/?release=7&arch=x86&repo=os’ —-> Failed. Turned out, I wasn’t able to connect to the internet at all through my VM. Checked network settings on the VM. It looked perfect. The problem was – CentOS by default sets network services to OFF status while booting up. On top of that, eth0 might get renamed to some random eth. And I have no clue, why anyone in their right mind would design it that way ! But this is what I did to get the system online. In network config settings of CentOS , find out where is eth0 (and if it got renamed to something else) and set it to start network services on boot.
cd /etc/sysconfig/network-scripts dmesg | grep eth0
The last line in the snapshot says that eth0 got renamed to eno1677736 Modify that eth file to start it on boot :
vi /etc/sysconfig/network-scripts/ifcfg-eno1677736
In the last line set onboot=yes
And now restart the network services : sudo service network restart If that doesn’t work, just reboot the system. That should solve the problem 🙂