【CentOS7】yum安装时出现错误Errno 14 Couldn't resolve host的解决办法

在安装python-sphinx时出现Errno 14 Couldn't resolve host,什么东东?

[root@localhost jansson-1.2]# yum install python-sphinx
Loaded plugins: fastestmirror
http://yum.loway.ch/RPMS/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: yum.loway.ch; Unknown error"
Trying other mirror.
http://mirrors.cqu.edu.cn/CentOS/7.2.1511/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.cqu.edu.cn; Unknown error"
Trying other mirror.
http://mirrors.tuna.tsinghua.edu.cn/centos/7.2.1511/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.tuna.tsinghua.edu.cn; Unknown error"
Trying other mirror.
http://mirrors.neusoft.edu.cn/centos/7.2.1511/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.neusoft.edu.cn; Unknown error"
Trying other mirror.
http://mirrors.163.com/centos/7.2.1511/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.163.com; Unknown error"
Trying other mirror.
http://mirror.bit.edu.cn/centos/7.2.1511/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirror.bit.edu.cn; Unknown error"
Trying other mirror.
http://mirror.lzu.edu.cn/centos/7.2.1511/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirror.lzu.edu.cn; Unknown error"
Trying other mirror.

一眼一看就知道是网络的问题,是不是没设置DNS,检查下果然是。

注意:

     在CentOS 7下不要直接修改/etc/resolv.conf,而是应该使用Systemctl restart NetworkManager命令,它会根据/etc/sysconfig/network-scripts/ifcfg-eth0自动生成etc/resolv.conf。


你可能感兴趣的:(调试总结,Yum,CentOS7,resolv.c)