[SOLVED] yum does not find any extrernal files; wget does

Issues related to software problems.
Post Reply
myudkowsky
Posts: 2
Joined: 2015/10/29 17:15:17

[SOLVED] yum does not find any extrernal files; wget does

Post by myudkowsky » 2015/10/29 17:45:35

Problem:

When I use

Code: Select all

yum update
,

Code: Select all

yum list
, or

Code: Select all

yum repolist
, yum fails with URL related errors.

Details:

When I run yum, errors appear in the form

Code: Select all

yum --disablerepo=\* --enablerepo=base,updates update
Loaded plugins: fastestmirror
Config time: 0.134
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=updates error was
[Errno 4] IOError: <urlopen error (-2, 'Name or service not known')>
and also in the form

Code: Select all

http://mirror.steadfast.net/centos/5.11/os/x86_64/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (-2, 'Name or service not known')>
Trying other mirror.
I can find these repos, or the repomd.xml file, if I use curl, wget, or my browser.

In yum.conf, have tried both mirrorlist (the list of mirrors can't be found) and baseurl with a list of mirrors obtained using curl. The latter fails when it tries to retrieve repomd.xml

Only base, updates, and extras repos are enabled.

I am not behind a proxy.

I see no messages in /var/log.

Any ideas on what might be wrong?

I have placed getinfo output into http://pastebin.centos.org/35776/
Last edited by myudkowsky on 2015/10/30 16:16:22, edited 1 time in total.

myudkowsky
Posts: 2
Joined: 2015/10/29 17:15:17

Re: yum does not find any extrernal files; wget does

Post by myudkowsky » 2015/10/30 16:15:42

This problem solved - by debugging Python.

yum is based on Python, and the error message is a Python error message. After reading in other forums, notably StackOverflow, I found a comment about a problem with libraries that Python depends on. In particular, some libraries have trouble with DNS entries.

Example:

Code: Select all

# python
>>> from urllib import urlopen
>>> urlopen("https://google.com")
results in the same error message. The problem is DNS lookups in Python, not yum itself.

To fix, this, I started nscd, which was not running on my system. This program caches DNS entries.

As root,

Code: Select all

 service nscd start
I then decided to "seed" the nscd repository in order to make certain the DNS entry for centos.org itself was present:

Code: Select all

curl http://mirrorlist.centos.org
After this, yum worked without any problems. Please note that in 5.11, nscd no longer appears to be necessary.

Post Reply