-2

Can someone help me to solve the below problem. I'm not able to install any software with yum.

Error Displayed

# yum update
Loaded plugins: fastestmirror
Determining fastest mirrors
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. $releasever is not a valid release or hasnt been released yet/
removing mirrorlist with no valid mirrors: /var/cache/yum/i386/$releasever/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base

Thanks for the support

Thanks,

user9517
  • 114,104
  • 20
  • 206
  • 289

2 Answers2

2

The value of $releasever is determined by taking the distroverpkg configuration value, which may be set in yum.conf but would normally be left at the default value, and then checking to see what version of that package is installed.

By default that will be the redhat-release release package, so check what version of that you have installed, and that nobody has set distroverpkg to something silly in yum.conf.

TomH
  • 1,290
  • 7
  • 9
  • Thanks a lot for the information. Here's what I have on my yum.conf. The distroverpkg=centos-release there is no version specified for it. Can you help me out.. cat /etc/yum.conf [main] cachedir=/var/cache/yum/$basearch/$releasever keepcache=0 debuglevel=2 logfile=/var/log/yum.log exactarch=1 obsoletes=1 gpgcheck=1 plugins=1 installonly_limit=5 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum distroverpkg=centos-release Thanks, – Jimmy Reel Dec 18 '12 at 16:00
  • @JimmyReel Welcome to Server Fault. You should edit your question with requested information, rather than adding it to comments, because it may not be noticed here and is difficult to read anyway. – Michael Hampton Dec 18 '12 at 17:23
  • @JimmyReel Your next step is to use `rpm -q centos-release` to see what version of that package you have installed. – TomH Dec 18 '12 at 19:23
  • @TomH Thanks, Here's what I get when I do [root@server1 ~]# rpm -q centos-release package centos-release is not installed. – Jimmy Reel Dec 19 '12 at 11:36
  • 1
    Well that's your problem - you need to install that so that `yum` can figure out the value for `$releasever`. – TomH Dec 19 '12 at 12:03
0

First use the command to check the packages like yum, rpm, python are installed or not.

rpm -q centos-release yum rpm python python-elementtree rpm-python yum-metadata-parser

In result column seek the packages yum and rpm and check whether its installed or not. If not use the command to install the yum rpm and other python which is mandatory for yum and rpm

yum --disablerepo=* --enablerepo=c6-media install centos-release yum rpm python python-elementtree rpm-python yum-metadata-parser

c6 or c5 used according to os version