Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I try to yum install anything I get:

-bash-3.2# yum install strace
Loading "fastestmirror" plugin
Determining fastest mirrors
 * dag:
 * lxlabsupdate:
 * rpmforge:
 * lxlabslxupdate:
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
# 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.

name=CentOS-$releasever - Base

#released updates
name=CentOS-$releasever - Updates
#additional packages that may be useful

name=CentOS-$releasever - Extras

name=CentOS-$releasever - Plus

name=Dag RPM Repository for Centos

name=CentOS-$releasever - Addons

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

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


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

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

share|improve this answer

Your Answer


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.