VMware下centOS yum报错cannot find a valid baseurl or repo:base 解决方法

*无法联网的明显表现会有:

  1、yum install出现 Error: cannot find a valid baseurl or repo:base

  2、ping host会提示unknown host


方法:

  1、打开 vi /etc/sysconfig/network-scripts/ifcfg-eth0(每个机子都可能不一样,但格式会是“ifcfg-eth数字”),把ONBOOT=no,改为ONBOOT=yes

  2、重启网络:service network restart

image

原文地址:https://www.cnblogs.com/amadeuslee/p/8808995.html