When I try to yum install anything I get:
-bash-3.2# yum install strace
Loading "fastestmirror" plugin
Determining fastest mirrors
* dag: apt.sw.be
* lxlabsupdate: download.lxlabs.com
* rpmforge: fr2.rpmfind.net
* lxlabslxupdate: download.lxlabs.com
YumRepo Warning: not using ftp, http[s], or file for repos, skipping - 5.2 is not a valid release or hasnt been released yet
removing mirrorlist with no valid mirrors: //var/cache/yum/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base
In /etc/yum.repos.d I have files:
CentOS-Base.repo CentOS-Media.repo mirrors-rpmforge
CentOS-Base.repo.rpmnew lxlabs.repo rpmforge.repo
CentOS-Base.repo:
# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# 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=5.2&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=5.2&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=5.2&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&rep$
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
[dag]
name=Dag RPM Repository for Centos
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
[addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=5.2&arch=$basearch&repo=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
enabled=1
How to fix it?
Change
?release=5.2
to?release=5
in your .repo files.The URL in the
mirrorlist
property in your CentOS-Base.repo file from/etc/yum.repos.d/
is defined wrong. It has hardcoded the release version number as 5.2 instead of 5. Rather than hardcoding the version number, I would recommend using the system provided variables in the URL as shown in your baseurl entries.So you want something like this instead for each entry (keep the existing
repo=
value):Add a full release version number (e.g., '5') to the file '/etc/yum/vars/releasever'. You will likely need to create the directory '/etc/yum/vars/' as well. Doing so obviates the need to directly edit any repo files, and your customized value persists through package and OS upgrades; just remember to change the value appropriately (if you upgrade to a new OS version, etc.).