Today I will teach you how to fix PYCURL ERROR 6 – “Couldn’t resolve host ‘mirrorlist.centos.org'”. This issue is most commonly encountered when trying to run the yum update command on a CentOS based distro with the following error log:

$ yum update
-----------------------------------------------------------
Loading mirror speeds from cached hostfile
Error: Cannot find a valid baseurl for repo: base
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os&infra=stock error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
-----------------------------------------------------------

SOLUTION:

To fix the error is quite easy, we just need to add Google Public DNS as a DNS resolver in the /etc/resolv.conf file. Add the following variables at the very bottom line of the /etc/resolv.conf file.

nameserver 8.8.8.8
nameserver 8.8.4.4

Then please try to reboot your server and run the system update command once again using the following command:

$ yum update
Previous articleHow To Install phpMyAdmin Manually on CentOS 7 with NGINX & PHP-FPM
Next articleHow To Change Hostname on Linux via Command-Line Interface (CLI)

LEAVE A REPLY

Please enter your comment!
Please enter your name here
Captcha verification failed!
CAPTCHA user score failed. Please contact us!

This site uses Akismet to reduce spam. Learn how your comment data is processed.