What is $releasever

Jonathan Ryshpan jonrysh at pacbell.net
Fri Feb 6 01:40:03 UTC 2009

On Fri, 2009-02-06 at 00:19 +0100, Jos Vos wrote:
> On Thu, Feb 05, 2009 at 03:11:18PM -0800, Jonathan Ryshpan wrote:
> > I occasionally have to find repos on the web, using a browser.  It helps
> > to know the values of $basearch and $releasever.
> > 
> > It looks like basesearch=`uname -m`
> > but what is releasever?
> > 
> > BTW: It would be nice if this were part of the yum man page or info
> > file.
> man yum.conf:
>        $releasever
>               This will be replaced with the value of the version of the pack-
>               age listed in distroverpkg. This  defaults  to  the  version  of
>               ‘redhat-release’ package.
Foolish of me not to run "man yum.conf".  

So let me play this back to you:

Man yum.conf tells me to look in distroverpkg.  A short web search tells
me that this is an rpm, whose name can be found by running:
        yum whatprovides redhat-release

Actually running this gives the output:
        $ yum whatprovides redhat-release
        fedora-release-10-1.noarch : Fedora release files
        Repo        : fedora
        Matched from:
        Other       : redhat-release

        generic-release-9.91-2.noarch : Generic release files
        Repo        : fedora
        Matched from:
        Other       : redhat-release

        generic-release-10-1.noarch : Generic release files
        Repo        : updates
        Matched from:
        Other       : redhat-release

        fedora-release-10-1.noarch : Fedora release files
        Repo        : installed
        Matched from:
        Other       : Provides-match: redhat-release

Since I'm running Fedora-10, the last item looks like the right one, and
in fact:
        $ rpm -q fedora-release-10
What's more:
        $ rpm -qa '*release*'
doesn't show anything promising.

fedora-release-10-1.noarch contains a promising file:
        $ cat /etc/fedora-release 
        Fedora release 10 (Cambridge)
So I suspect that $releasever has the value "10", and not "f10" or
"fc10" or "Fedora-10", or whatever.

I'm sorry, but I think this is all about as clear as mud.

Thanks again - jon

More information about the Rpm-list mailing list