I run several Arch Linux boxes at home. Updating these boxes involves a number of redundant actions: download new packages on each machine, install the package on each machine, and store every previously installed package on each machine. I recently wrote a script to eliminate two of these redundancies.
The script mounts a package cache from an NFS server before running pacman, and downloads and installs the packages from the NFS mount. After finishing the install, the script unmounts the NFS share and rsyncs the currently installed packages to the local package cache. Finally, the script cleans the cache, removing all old versions of packages.
Using this script enables me to do several things:
- I only download new packages once. Installs on other machines use the package from the NFS cache.
- I can keep a full history of all installed packages in a central place
- I keep the package caches on my machines down to a manageable size.
You can download the script at http://www.jafrro.net/download/lan_update.sh