Network Shared Pacman Cache

From ArchWiki
Revision as of 17:24, 14 December 2008 by Byte (talk | contribs) (rm all traces of [unstable] (and other cruft))
Jump to: navigation, search

In order to share packages between multiple computers you can simply share /var/cache/pacman/ using any network-based mount protocol. This guide shows you how to use shfs or sshfs to share a package cache plus the related library-directories between multiple computers on the same local network.

First, install any network-supporting filesystem; for example sshfs, shfs, ftpfs, smbfs or nfs

Then, to share the actual packages you should mount /var/cache/pacman/pkg from your server to /var/cache/pacman/pkg on every client machine.

If you also want to have shared package databases you will need to mount /var/lib/pacman/{core,extra,testing,community} in the same way. Warning: do not mount /var/lib/pacman/local as it contains your actual [local] database!

You may put the appropriate lines in your /etc/fstab file

Note: using shared database can be slow, depending on network filesystem type and LAN load. Tip: if you want to use sshfs or shfs you should consider reading Using SSH Keys.


As of version 3.1 "pacman -Sc" changed behavior. By default it does no longer remove all outdated package files but all package files which are not installed on the machine the command was issued on. Because Pacman can't predict what packages are installed on all machines that share the cache, you will end up deleting files you don't want to delete. If you want to clean up your cache to only keep the newest packages you will have to put CleanMethod = KeepCurrent in the [Options] section of /etc/pacman.conf.