YUM安装东西提示PYCURL ERROR 6 - "Couldn't错误的解决办法

时间:2023-03-08 21:43:17
YUM安装东西提示PYCURL ERROR 6 - "Couldn't错误的解决办法

执行yum install命令时提示PYCURL ERROR 6 - "Couldn't resolve host 错误,原来是dns设置出错,具体错误代码:

 Loaded plugins: fastestmirror, refresh-packagekit, securityDetermining fastest mirrorshttp://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 updateLoaded plugins: fastestmirror, refresh-packagekit, securityLoading mirror speeds from cached hostfilehttp://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

注解:8.8.8.8 是谷歌提供的免费DNS服务器地址。