[SLL] yum repos and the mysterious life of releasever

jkeating jkeating at j2solutions.net
Wed Oct 17 13:33:54 PDT 2007


On Wed, 17 Oct 2007 12:49:58 -0700 (PDT)
xeno at eskimo.com wrote:

> I'm trying to get a handle on yum repos and after over an hour
> looking through Google for good instructional documents have found
> myself very unsatisfied. Has anyone a recommendation for a good doc
> with examples on making detailed customized yum repos, and perhaps
> that explain reasonably and clearly where in the name of the
> redhatter gremlin gods the releasever variable is actually set, and
> perhaps some nice clear and easy to use command to get the value from
> simply and reliably?


That's not set in the repo, it's set by the client on the client
system.  You'll have to dig a bit into yum client code but basically
the "release" value of the package that provides
the /etc/redhat-release file.

$ rpm -qf /etc/redhat-release 
fedora-release-7.92-2

In my case, the $releasever would be "7.92".  On a Fedora 7 machine
where the package is say fedora-release-7-4, $releasever is 7.

$ rpm -qf --qf "%{VERSION}\n" /etc/redhat-release

That should suffice to figure out what the $releasever would be.  Of
course you're going to tell me that not every system that uses yum has
an /etc/redhat-release file.  This is true, some don't.  The way yum
really does it is there is a config entry that sets what the
'distroverpkg'.  Then yum figures out based on the rpmdb what real
package "provides" the 'distroverpkg', and then the VERSION of /that/
package is discovered and used.  There just isn't necessarily an easy
way from the command line to do this, so for Red Hat based products
querying the package that provides some /etc/*-release file would
suffice. 

The reason there isn't much documentation to creating yum repos is
because there is not much to it.  You put rpms in a directory and you
call createrepo on that directory.  Bam you have a yum repo.  You can
then share this repo via file:///, http://, or ftp://.  The "custom"
part of it all comes down to what content you out /in/ the repo, not
necessarily how you /create/ the repo.



-- 
Jesse Keating RHCE      (jkeating.livejournal.com)
Fedora Project          (fedoraproject.org/wiki/JesseKeating)
GPG Public Key          (geek.j2solutions.net/jkeating.j2solutions.pub)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists2.linuxjournal.com/pipermail/linux-list/attachments/20071017/b9ba66b4/attachment.sig 


More information about the linux-list mailing list