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]# 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[/code]
To test my connectivity, I run:
[code]curl "http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=os"[/code]
and the output is, as expected, a list of mirrors:
[code]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.>
[/code]
I'm a bit stuck here. I ran
[code]yum clean all
yum --disable=\* --enablerepo=base,extras,updates update
[/code]
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][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
[/code]
and /etc/yum.repos.d/CentOS-Base.conf is
[code]
# 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
[/code]
yum cannot retrieve mirror list, but curl can
-
- Posts: 14
- Joined: 2012/02/15 16:41:40
- Contact:
-
- Retired Moderator
- Posts: 18276
- Joined: 2006/12/13 20:15:34
- Location: Tidewater, Virginia, North America
- Contact:
yum cannot retrieve mirror list, but curl can
Welcome to the CentOS fora. Please see the recommended reading for new users linked in my signature.
Are you behind a proxy? See [b]man yum.conf[/b], [url=http://wiki.centos.org/TipsAndTricks/YumAndRPM#head-ea1fc5d78f578114f4843e57627ebae9cc4fcb5a]Using yum with a proxy server[/url], and the [url=http://wiki.centos.org/PackageManagement/Yum/FastestMirror]fastestmirror[/url] plugin.
Are you behind a proxy? See [b]man yum.conf[/b], [url=http://wiki.centos.org/TipsAndTricks/YumAndRPM#head-ea1fc5d78f578114f4843e57627ebae9cc4fcb5a]Using yum with a proxy server[/url], and the [url=http://wiki.centos.org/PackageManagement/Yum/FastestMirror]fastestmirror[/url] plugin.
-
- Posts: 14
- Joined: 2012/02/15 16:41:40
- Contact:
Re: yum cannot retrieve mirror list, but curl can
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.
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.
-
- Retired Moderator
- Posts: 18276
- Joined: 2006/12/13 20:15:34
- Location: Tidewater, Virginia, North America
- Contact:
Re: yum cannot retrieve mirror list, but curl can
Perhaps you could [url=http://www.centos.org/modules/newbb/viewtopic.php?topic_id=28723&forum=54]provide more information about your system[/url] to give us a better chance of helping.
-
- Posts: 14
- Joined: 2012/02/15 16:41:40
- Contact:
Re: yum cannot retrieve mirror list, but curl can
Thank you. I've included the information from "getinfo network" in [url=http://pastebin.centos.org/38389]this pastebin.[/url]
-
- Retired Moderator
- Posts: 18276
- Joined: 2006/12/13 20:15:34
- Location: Tidewater, Virginia, North America
- Contact:
Re: yum cannot retrieve mirror list, but curl can
Your route is broken. [OT: Disabling SELinux is not advisable.]
-
- Posts: 14
- Joined: 2012/02/15 16:41:40
- Contact:
Re: yum cannot retrieve mirror list, but curl can
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.
If this turns out to be consistent I'll mark this as closed.