linux # centos7 # Couldn't resolve host

实体机上装了linux后,配置了repo后,
yum install vim,出现 Couldn't resolve host的问题。
应该是网络配置还有问题。

打开文件/etc/resolv.conf在其中添加:

 nameserver 8.8.8.8
vi  /etc/sysconfig/network-scripts/ifcfg-ethx
ONBOOT = YES

reboot重启。

centos中用

ip addr

查看ip信息。

References:

https://blog.csdn.net/baixue6269/article/details/42642479
https://blog.csdn.net/llnara/article/details/8645846
https://jingyan.baidu.com/article/84b4f565cb7afa60f6da32d4.html
https://jingyan.baidu.com/album/7f41ecec1b022e593d095c1e.html?picindex=5
https://jingyan.baidu.com/article/84b4f565cb7afa60f6da32d4.html

你可能感兴趣的:(linux # centos7 # Couldn't resolve host)