Completely using an alternate yum configuration

August 24, 2005

As part of automatic installs of Fedora Core, our customization step installs of the current Red Hat updates from a local mirror. We use yum for this, because it both handles dependencies and uses compact metadata files instead of having to read all of the update and base OS RPMs themselves. (We have 100 megabit networks, but it still adds up and slows down installs.)

We do this by feeding yum a custom configuration file; basically we take the standard /etc/yum.conf file and add some bits to point to our on-disk repositories. (In turn, this means I get to explore the many charms and wonders of building yum metadata. Which deserves an entry itself.)

This mostly works, but with Fedora Core 4 this step started bitching about 'ignoring duplicate entry for <repository type>'. Since it worked, I ignored it. As part of diagnosing the install failure yesterday, this escalated to a fatal problem: yum died with that ever-helpful message:

Cannot find a valid baseurl for repo: extras

This was mysterious, because our yum configuration doesn't have an 'extras' repository, only 'base' (base Fedora Core 4 RPMs) and 'updates-released' (the updates themselves).

The cause is a new feature in yum, where it will look in a list of directories for files that describe additional repositories. (In Fedora Core 4, Red Hat sets up all of the repositories this way for reasons having to with how RPM operates.)

This new features, reposdir, does not have to be explicitly specified in your yum configuration file; yum uses a default directory search path. Fedora Core 4 uses both the feature and one of the default directories, so no reposdir entry is in /etc/yum.conf.

Since our one started as a copy of that, we hadn't set a reposdir either, so yum was seeing our explicitly specified repository locations and then also reading the normal system ones. This resulted in the duplicates of 'base' and 'updates-released' that yum had been warning about, and when the install-time nameservice was broken a complete inability to get information on the contents of 'extras', a fatal error.

So: to completely use an alternate yum configuration file, you need to set an explicit reposdir. Yum is happy with the directory not existing (assuming you specify the necessary repositories explicitly in your configuration file), but you have to override the default with something.


Comments on this page:

From 210.210.12.140 at 2005-12-01 11:06:08:

Thanks a lot for reposdir info in yum section.

I had almost hit the wall trying to figure out why yum is looking for extras repository.

Its nice to see good people adding these helps on internet.

thanks again figona

Written on 24 August 2005.
« Diagnosing an install problem: a case study in indirect failures
Another aphorism of system administration »

Page tools: View Source, View Normal.
Search:
Login: Password:

Last modified: Wed Aug 24 03:24:24 2005
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.