Ask Your Question
2

Can I set up my Fedora systems in a way that will enable them to reuse updates downloaded on one system for another?

asked 2014-09-17 20:43:03 -0500

FranciscoD_ gravatar image

Hi,

I have a couple of Fedora 21 systems here. Each time updates are released, I update these individually and this causes a lot of packages to be downloaded multiple times - once on each system. I was wondering what the best way would be to reduce this download. For example, I can probably use the cache of one system as a local home repo and make the other systems check this along with the Fedora repositories. Can someone with such a set up share the steps required to construct it?

edit retag flag offensive close merge delete

Comments

if bandwidth is not the issue for you then you can sync daily updates repo locally on some machine and use downloaded directory as a repo for all your machines. Or if you have bandwidth issue or want to download only updates for installed packages (I assume then you have all the systems with same package set) then I think you can use yum's download packages and keep storing it somewhere and point this location to all the systems. If I am not wrong then there is no such download only option in dnf yet.

pnemade gravatar imagepnemade ( 2014-09-17 22:36:11 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
4

answered 2014-09-18 05:38:50 -0500

hedayat gravatar image

I'd suggest installing yum-plugin-local on one of the systems on which you'll download updates from Fedora repositories. This plugin copies all packages you install/update using yum in a single directory (/var/lib/yum/plugins/local by default) and creates a single repository there using createrepo. Each time you get new packages, they'll be added to this repository automatically.

There is only one drawback with this plugin: it calls createrepo everytime you install/update some packages, which could be slow when the local repository becomes large. However, you can disable calling createrepo by this plugin in its settings and run it manually when really needed (or use a cron job to run it periodically).

Also, this repository will contain all versions of a package you've ever installed. So, you might decide to clean it up from time to time. I do it using repomanage -o . | xargs rm inside repository directory to remove older versions of each package. You might decide to be more conservative: e.g. keeping two last versions of each package. Consult repomanage manual for more options.

You can put this repository somewhere accessible by Apache and add a repository file to all other systems to point to this local repository using HTTP. Don't forget to open HTTP port (80) in your firewall settings! Also, add a cost=500 configuration to the repository settings file so that packages from this repository are preferred over the packages available in Fedora repositories (default repository cost is 1000, so a repository with a lower cost is preferred when the same package is available in multiple repositories).

Finally, if you have third party repositories enabled, you should probably disable GPG key check for this local repository since its package come from different repositories and might/might not be signed by a key available to Yum.

A sample config file would be like this (this is a modified version of _local repository created by yum-plugin-local which points to a repository in local network rather than same host. It also has some comments about using/not using cost setting. But I'd suggest using it specially if you decided to name this repository something other than _local):

[_local]
name=Local Fedora Packages repository
baseurl=http://192.168.100.1/local_repo/
enabled=1
gpgcheck=false
metadata_expire=1h
#  Make cost smaller, as we know it's "local". If you really want to be sure,
# you can do this ... but the name will do pretty much the same thing, and that
# way we can also see the other packages (with: --showduplicates list).
cost=500
edit flag offensive delete link more

Comments

Great answer. Thanks @hedayat.

FranciscoD_ gravatar imageFranciscoD_ ( 2014-09-18 06:03:37 -0500 )edit

yes this is really a great answer :)

pnemade gravatar imagepnemade ( 2014-09-18 07:23:04 -0500 )edit

Thanks :">

hedayat gravatar imagehedayat ( 2014-09-18 13:03:36 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-09-17 20:43:03 -0500

Seen: 434 times

Last updated: Sep 18 '14