[Yum] Caching remote data for multiple computers

James Antill james-yum at and.org
Mon Dec 21 14:55:31 UTC 2009

Pierre Guillet <guillet.pierre at googlemail.com> writes:

> Hello list,
> In yum Wiki (http://yum.baseurl.org/wiki/YumMultipleMachineCaching)
> for "rsync /var/cache/yum and set keepcache=1 in yum" solution, James
> wrote in cons point:
> preupgrade/etc. doesn't easily share data with "normal" yum, even if
> they need the same data.
> Can someone (James ?) explain this sentence ? What is "normal" yum ?
> Does it means that I cannot perform a "yum upgrade" on a server, which
> uses the replicated cache ?

 The basic problem is repoids, say you have two repos. "foo" and "bar"
both of which have package X-1-2. In the old default the package will be
stored in one of:


...depending on which repo. you got it from. There are two problems
here, as it relates to preupgrade:

1. Fedora has an install repo. and an installed repo. (which point to
different places, and the former is a subset of the later).

2. preupgrade sets custom repoids.

> Another question about this configuration:
> Do you know a tool like a local yum makecache to rebuild metadata with
> only the list of downloaded packages (RPM in yum cache) ?
> May be a "createrepo" for each section in the cache ?
> The server, which uses the replicated cache, uses the replicated
> metadata and these metadata contain the list of all packages on the
> original repository.

 There is a recent tool in yum-utils called "yum-plugin-local" which
copies all downloaded packages to /var/lib/yum/plugins/local and runs
createrepo there. The main feature is that you can always downgrade to
a package you'd previously installed, but you could use that for
sharing over multiple machines.

> If somebody has installed a package directly with rpm command, yum
> update fails if an update is available because the package is not in
> the cache.
> With the metadata restricted to the packages in cache, this problem
> can't occur.

 It wouldn't fail though, in this case. However the recentish "rpmdb
version" feature is meant to help with running multiple machines like
this. Basically as you install the machines they'll have the same
"yum version", then you just have to monitor that they continue to
have the same versions (and "yum history" can help you find out why
they don't).

James Antill -- james at fedoraproject.org

More information about the Yum mailing list