yum local repos first?

Paul Howarth paul at city-fan.org
Sat Apr 8 11:52:37 UTC 2006


On Sat, 2006-04-08 at 12:30 +0100, Timothy Murphy wrote:
> Paul Howarth wrote:
> 
> >> Is there some way to specify a repo "preference" so
> >> that the local repos will be used to satisfy dependencies
> >> before going to remote repos?
> > 
> > Afraid not, unless you disable the core repo itself.
> 
> As a matter of interest,
> what happens if the .repo file has two baseurl's listed?
> In my case, it always seems to choose the first for "yum update".
> My assumption was that it only looks at the second baseurl
> if it does not find repomd.xml at the first.
> Is that correct?

It tries the baseurls in random order unless "failovermethod=priority"
is set in the .repo file or /etc/yum.com

It switches to a different mirror when it fails to retrieve data from
the first one.

> But what if you try "yum install" and it doesn't find the rpm
> in the first baseurl ?
> I assume it goes on to the next repo,
> rather than looking at another baseurl in the same .repo file.
> Is that correct?

That would depend on the metadata at the first baseurl. If the metadata
said that the rpm should be there, it'll try a new baseurl. If not,
it'll look in a different repo.

So one possibility for the OP would to create a local repo for [core]
but instead of using "createrepo" to create the metadata, just copy the
metadata from the install media (which includes entries for all core
packages). Then use two baseurls (one local, one network) and
failovermethod=priority. Yum will expect the local repo to contain all
packages, and will fail over to the network one if it tries to retrieve
a package from the local repo that's not present. However, if this
happens early in the transaction, yum might still grab other packages
from the network repo that are actually present locally. The best
solution is definitely to have a full local core repo.

Paul.




More information about the users mailing list