How to resolve yum error [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host"

Yum-and-RPM---Red-Hat,-Centos After installing CentOS, you may encounter “[Errno 14] PYCURL ERROR 6 - “Couldn’t resolve host"" when installing or updating through yum, as shown below.

http://mirrors.psu.ac.th/pub/centos/6.4/extras/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.psu.ac.th'"
Trying other mirror.
http://mirrors.neusoft.edu.cn/centos/6.4/extras/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.neusoft.edu.cn'"
Trying other mirror.
http://mirrors.yun-idc.com/centos/6.4/extras/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.yun-idc.com'"
Trying other mirror.
http://mirrors.stuhome.net/centos/6.4/extras/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.stuhome.net'"
Trying other mirror.
http://centos.ustc.edu.cn/centos/6.4/extras/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'centos.ustc.edu.cn'"
Trying other mirror.

To investigate and fix “[Errno 14] PYCURL ERROR 6 - “Couldn’t resolve host"", follow these steps:

  1. Check that the machine’s network connection works.
  2. Check that DNS lookups work. If they do not, inspect /etc/resolv.conf and verify that the nameserver configuration is correct.

If both checks pass but the problem remains, IPv6 is a likely cause. There are two possible workarounds:

  1. Map the domain names and IP addresses needed by yum in /etc/hosts (this also requires setting baseurl in the repository file so that the correct files can be retrieved).

  2. Disable IPv6 as follows. Create /etc/modprobe.d/ipv6.conf and add the following parameter.

    options ipv6 disable=1
    install ipv6 /bin/true
    blacklist ipv6
EOF.← Back to articles