centos7初装系统-cannot find a valid baseurl for repo:base/7/x86_64

安装CentOS7文字界面版后,无法联网,用yum安装软件提示 cannot find a valid baseurl for repo:base/7/x86_64 的解决方法

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

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

方法二、

1、打开 vi /etc/resolv.conf,增加 nameserver 8.8.8.8

2、重启网络: service network restart

来自:https://www.cnblogs.com/hopkings/p/6140654.html

 

我这边的文件名字是     /etc/sysconfig/network-scripts/ifcfg-enp0s3

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments