Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
Please provide the file list for your /etc/yum.repos.d/ directory and the contents of the .repo file containing the base repo. –  Ophidian May 12 '10 at 12:51
    
@Ophidian I've added list of files at yum.repos.d and content of CentOS-Base.repo. Is it helpful? –  tomaszs May 12 '10 at 14:24
    
Very helpful, I have updated my answer –  Ophidian May 12 '10 at 14:43
add comment

2 Answers

up vote 2 down vote accepted

Change ?release=5.2 to ?release=5 in your .repo files.

share|improve this answer
    
Thank you. It helped! –  tomaszs May 16 '10 at 9:45
add comment

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):

mirrorlist=http://mirrorlist.centos.org/?release=5.2&arch=$basearch&repo=os

share|improve this answer
    
Thank you for complete solution. It's good solution. –  tomaszs May 16 '10 at 9:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.