Monday, April 23, 2018

CentOS: Docker: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org ...みたいなのが出てくる時

以下のようなエラーが出る時

....
e=6&arch=x86_64&repo=os&infra=container error was  
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org
Error: Cannot find a valid baseurl for repo: base  
Loaded plugins: fastestmirror, ovl 
Setting up Install Process 
Loading mirror speeds from cached hostfile 
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os&infra=container error was 14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"

ネットワークの設定周りが腐ってるということなので、
以下の対処法で大丈夫:
$ echo "nameserver 8.8.8.8 nameserver 8.8.4.4 nameserver 127.0.0.1" > /etc/resolv.conf
$ yum install httpd -y
$ ifdown eth0; ifup eth0

http://utdream.org/post.cfm/yum-couldn-t-resolve-host-mirrorlist-centos-org-for-centos-6

No comments:

Post a Comment