yum cannot retrieve mirror list, but curl can

Issues related to software problems.

yum cannot retrieve mirror list, but curl can

Postby myudkowsky2 » 2012/02/15 16:57:15

Question: yum can't find the mirrors while other software can. How can I fix yum?

Details:

Any number of posts show the typical yum problem:
Code: Select all
# yum --enablerepo=base,extras,updates update
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=os
error was [Errno 4] IOError: <urlopen error (-2, 'Name or service not known')> 
Cannot find a valid baseurl for repo: base


To test my connectivity, I run:
Code: Select all
curl "http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=os"

and the output is, as expected, a list of mirrors:
Code: Select all
http://mirrors.adams.net/centos/5.7/os/x86_64/
ftp://ftp.ussg.iu.edu/linux/centos/5.7/os/x86_64/
http://centos.aol.com/5.7/os/x86_64/
<etc.>


I'm a bit stuck here. I ran
Code: Select all
yum clean all
yum  --disable=\* --enablerepo=base,extras,updates update

as recommended in the forums in order to try to fix this problem,but I'm stuck at this step. A reboot of the system (lockfile? permissions problem?) did dnot help.

yum did work on this one-week-old install, and I can't think of anything I might have done to create this problem. I do confess to running esoteric telephony software.

Please let me know if more information is needed.
/etc/yum.conf:
Code: Select all
[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum

# Note: yum-RHN-plugin doesn't honor this.
metadata_expire=1h

installonly_limit = 5

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d


and /etc/yum.repos.d/CentOS-Base.conf is
Code: Select all
# cat  /etc/yum.repos.d/CentOS-Base.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
myudkowsky2
 
Posts: 14
Joined: 2012/02/15 16:41:40

yum cannot retrieve mirror list, but curl can

Postby pschaff » 2012/02/15 18:55:02

Welcome to the CentOS fora. Please see the recommended reading for new users linked in my signature.

Are you behind a proxy? See man yum.conf, Using yum with a proxy server, and the fastestmirror plugin.
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: yum cannot retrieve mirror list, but curl can

Postby myudkowsky2 » 2012/02/15 22:23:18

Phil,

Thanks for your response. I am not behind a proxy, and the fastmirror plugin is installed and configured as per the standard default configuration. The fastmirror data file, /var/cache/yum/timedhosts.txt, is empty, probably due to my "yum clean all" command.

Do you have any other suggestions on how to proceed? I'm tempted to fall back to non-mirror operation, yum update everything, and retry.
myudkowsky2
 
Posts: 14
Joined: 2012/02/15 16:41:40

Re: yum cannot retrieve mirror list, but curl can

Postby pschaff » 2012/02/16 02:09:09

Perhaps you could provide more information about your system to give us a better chance of helping.
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: yum cannot retrieve mirror list, but curl can

Postby myudkowsky2 » 2012/02/16 13:22:35

Thank you. I've included the information from "getinfo network" in this pastebin.
myudkowsky2
 
Posts: 14
Joined: 2012/02/15 16:41:40

Re: yum cannot retrieve mirror list, but curl can

Postby pschaff » 2012/02/17 11:07:45

Your route is broken. [OT: Disabling SELinux is not advisable.]
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: yum cannot retrieve mirror list, but curl can

Postby myudkowsky2 » 2012/02/20 21:55:27

Something that I did while fiddling with the .local problem -- and I don't know exacatly what I did - caused yum to start working again.

If this turns out to be consistent I'll mark this as closed.
myudkowsky2
 
Posts: 14
Joined: 2012/02/15 16:41:40


Return to CentOS 5 - Software Support

Who is online

Users browsing this forum: No registered users and 3 guests