8

I am using Centos 7.1.1503 (core) as a VM. The host OS is Windows 10. I created this VM so this is a fresh installation of CentOS. My laptop has a direct connection to the internet, without a proxy.

When I execute the command yum update all I get with the error

Cannot find a valid baseurl for repo: base/7/x86_64

I went through various threads related to this error on Stackexchange.com and tried all the below suggestions:

  1. executed dhclient.

  2. Edited ifcfg-enp0s3 with information, as suggested in this question

  3. Uncommented the baseURL from the /etc/yum.repos.d/CentOS-Base.repo file

If I change the VirtualBox network settings to use "NAT", then I can see that yum is working without any issues. I can keep this setting, but I will not be able to access CentOS from my host OS, which is why I had used "Bridge" networking. When I use "Bridge" I am having this issue.

KurioZ7
  • 513

4 Answers4

3

It was a DNS issue. I kept the NAT setting and removed the BRIDGE settings. This ensured that my internet connectivity works. Yum also didn't have any problem. In order to connect from host to the guest, I used Port Forwarding in the network setting. I got this knowledge from this URL http://teaching.idallen.com/cst8207/14f/notes/000_centos_virtualbox_install.html

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
KurioZ7
  • 513
1

I fixed this problem by uncommenting all occurrences of baseurl and commenting out all occurrences of mirrorlist in /etc/yum.repos.d/CentOS-Base.repo.

yvoloshin
  • 111
1

I fixed this problem by editing and add a DNS address on the ifcfg-enp0s3 file. I added the 8.8.8.8 address for DNS.

frodon
  • 11
0

I fixed this issue by un commenting the previously commented baseURL in

/etc/yum.repos.d/CentOS-Base.repo

and commenting out the baseURL mirrorlist. Not sure if this would be fix by just simply uncommenting the baseURL. Will do some testing later.

UPDATE: mirrorlist needs to be commented out for this to work.