I maintain a number of non-internet connect computers which are running Arch Linux. I find it helpful to create a local repository that partially mirrors the typical Arch repositories. I keep this repository on a USB drive which I use to update the computers by making the appropriate changes to pacman.conf. I create the repository by generating a ListOfPackages which contains the names of all the packages (or package groups) that have been directly installed on the computers, but not packages that are pulled in as dependencies. The USB drive is mounted at /mnt. I then do

sudo pacman --dbpath /tmp --noconfirm -Syw ${ListOfPackages} --cachedir /mnt

for package in /mnt/*.pkg.tar.xz; do
  gpg --batch --yes -sb ${package}
  repo-add -v -s -q strongbad.db.tar.gz ${package}

which generates the strongbad repository. The problem comes when it is time to update the repository. Typically I just delete everything and start over to avoid keeping old versions and now unneeded dependencies, but this is a big waste of bandwidth. Is there a good way to update the packages and repository that minimizes the number of packages downloaded and cleans out cruft?

  • Look at pacserv and then just use -Sc or paccache to maintain the cache. – jasonwryan May 17 '18 at 23:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.