执行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服务器地址。

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-30
  • 2021-09-19
  • 2021-12-06
  • 2021-11-05
  • 2021-11-28
猜你喜欢
  • 2022-12-23
  • 2021-07-22
  • 2022-12-23
相关资源
相似解决方案