解决CentOS错误:Cannot find a valid baseurl for repo: base/7/x86_64,无法联网

错误提示:

已加载插件:fastestmirror, langpacks
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"

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

解决办法:

 查询网卡信息:

ifconfig
ens33: flags=4163  mtu 1500
        ether 00:0c:29:18:be:20  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

根据自己虚拟机打开对应的配置信息。

vi /etc/sysconfig/network-scripts/ifcfg-ens33

修改ONBOOT=no为ONBOOT=yes

重启网络。

systemctl restart network

 

你可能感兴趣的:(Linux)