执行yum install命令时提示PYCURL ERROR 6 - "Couldn't resolve host 错误,原来是dns设置出错,具体错误代码:
Loaded plugins: fastestmirror, refresh-packagekit, security Determining fastest mirrors http://mirrors.163.com/centos/6/os/i386/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.163.com'" Trying other mirror. Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again [root@mynginx /]# yum update Loaded plugins: fastestmirror, refresh-packagekit, security Loading mirror speeds from cached hostfile http://mirrors.163.com/centos/6/os/i386/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.163.com'" Trying other mirror. Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again [root@mynginx /]# /etc/resolv.conf |
解决办法:执行以下命令设置dns服务器即可:
echo "nameserver 8.8.8.8" > /etc/resolv.conf |