How To Fix CentOS Network Is Unreachable & Could Not Retrieve MirrorList Could Not Resolve Host mirrorlist.centos.org Unknown Error

Recently i installed CentOS 7.7 on oracle VirtualBox. After installation, when i run command yum update, it shows could not retrieve mirrorlist could not resolve host mirrorlist.centos.org unknown error.

When i run command ping www.google.com, it shows network is unreachable error. When i run below command to see network configuration, it all shows incorrect information.

cat /etc/resolv.conf

cat /etc/sysconfig/network

cat /etc/sysconfig/network-scripts/ifcfg-enp0s3

cat /etc/sysconfig/network-scripts/route-enp0s3

1. Fix CentOS 7 Network Is Unreachable & Could Not Retrieve MirrorList Error Steps.

The reason for this error is because i do not turn on ethernet network card when install CentOS, so i should reinstall CentOS and turn on the ethernet network card follow below steps.

  1. When install CentOS, in Name and operation system window, you should select Red Hat ( 64-bit ) in Version drop down list.
    install centos 7.7 in virtualbox select redhat linux
  2. In the INSTALLATION SUMMARY window, NETWORK & HOST NAME section,  you can see a smaller text Not connected under NETWORK & HOST NAME, click it to edit network settings.
    install centos 7.7 in virtualbox configure network and hostname
  3. When you click above NETWORK & HOST NAME item, it will display below window, select the Ethernet(enp0s3) in left list, turn on the toggle button in right side, then you can see the Ethernet status is Connected, and you can see related ip, dns server ip address below it.
    install centos enable ethernet network adapter
  4. You can also click the Configure… button in above window bottom right corner to customize the network settings, below is the configuration window that will popup when you click the Configure… button.
  5. In the General tab, i check the Automatically connect to this network when it is available checkbox.
    install centos edit network general tab
  6. In the IPv4 Settings tab, you can input your own DNS server ip in Additional DNS servers input text box.
    install centos edit network ipv4 settings tab
  7. Save above settings, and begin install the CentOS until success, after that you can find the network is available. You can run command $ ip address to get current os ip address.
READ :   How To Fix Error Job For [email protected]:1.service Failed Because The Control Process Exited With Error Code. See "systemctl Status [email protected]:1.service" And "journalctl -xe" For Details When Start VNC Server.

2. Select Bridged Adapter In Virtual Machine Network Settings.

  1. Right click the CentOS virtual machine, click Settings… menu item in the popup menu list.
    virtualbox centos vm settings menu item
  2. Click Network tab in top area, check Enable Network Adapter checkbox, then select Bridged Adapter in the Attached to drop down list.
    virtualbox vm settings network bridged network

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.