Operating System, Teknologi

Fixing PYCURL ERROR 6 – “Couldn’t resolve host ‘mirrorlist.centos.org'” on yum update

Problem:

Found this problem on Centos 6.4 x86_64 :
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was 14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'" Error: Cannot find a valid baseurl for repo: base

Solution:

And I tried to fix it by these steps:
1. edit network interface. For my case, I used eth0 in CentOS 6.X:
vim /etc/sysconfig/network-scripts/ifcfg-eth0
In CentOS 7.X you can use the ensxxx interface.

2. update NM_CONTROLLED to no
ONBOOT=no
NM_CONTROLLED=no
BOOTPROTO=dhcp
DNS1=8.8.8.8
DNS2=4.2.2.2

3. restart the network interface
ifdown eth0
ifup eth0

Hope this help

Advertisements
Standard

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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