You are not logged in.

#1 2025-11-18 13:11:55

Whoracle
Member
Registered: 2010-11-02
Posts: 176

Pacman pull-through cache

So, I'm running a small homelab with a bunch of arch machines, along with 2 desktops and 2 notebooks. I'm providing AUR packages via my own little repo on one of the VMs. The Desktops/Notebooks share a set of packages (mostly), and the VMs in the homelab share another set of packages (again, mostly).

Since both sets are usually Syu'd at the same time I was thinking of hosting some kind of pull-through cache for the packages, to speed up the installation. Running a full-fledged mirror is, of course, overkill - not in terms of space in my homelab, but in terms of bandwidth wasted at the upstream mirrors. So, anybody got suggestions on how to achieve a kind of centralized cache for pacman packages, something akin to what LANCache can do for Steam, only for pacman?

Way I envision it is: Host requests a package, asks the cache server. If cache hit, serve locally. If cache miss, fetch from upstream and cache result. Bonus points for configurable cache refresh - say "refresh all the packages you currently have every 6 hours" or so.

Edit: And of course, as soon as I post the question, I find https://wiki.archlinux.org/title/Packag … oxy_server. Well, I'm going to try that out, but in the meantime, other suggestions also welcome.

Last edited by Whoracle (2025-11-18 13:18:39)

Offline

#2 2025-11-18 13:50:03

teckk
Member
Registered: 2013-02-21
Posts: 552

Re: Pacman pull-through cache

That can be done multiple ways.

You can share a machines pacman cache directory with all other machines on the LAN. Or you can copy pacmans cache to all other machines.

I do it the manual way. I use the machine with the most packages installed on it and pacman -Syu to a temp dir.

pacman -Syuw --cachedir "$temp_dir"

Then start a web server on that directory. (python will do this, or other)

webserver "$temp_dir" --port 8100

Then get everything from that server to the pacman cache on each machine.

wget -P "$pac_cache" -r -nd <IP:PORT>

Then update that machine. All of the packages are already in pacmans cache directory.

pacman -Syu

At the end, when I get back around to the first machine, I move everything from the temp dir to pacmans cache and pacman -Syu on it.

Al machines have the same software, and the cache is backed up to multiple machines.

And of course, I use an update script for that.

I also updated grub last thing on that script each update, according to the EFI paths on each machine.

No special software to maintain. Just a bash script.

Offline

#3 2025-11-18 15:24:52

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 70,349

Re: Pacman pull-through cache

--cachedir and nfs or you could try whether https://aur.archlinux.org/packages/httpfs2 still works to skip the local copy if you want to go w/ a http server.

Offline

#4 Yesterday 19:20:02

NuSkool
Member
Registered: 2015-03-23
Posts: 283

Re: Pacman pull-through cache

I use pacoloco set up in an nspawn container, then point all my installs to it using CacheServer, as the first entry in the mirrorlist.

https://wiki.archlinux.org/title/Packag … che_server

Last edited by NuSkool (Yesterday 19:22:47)


Scripts I Use                                                 :  https://github.com/Cody-Learner
grep -m1 'model name' /proc/cpuinfo    : AMD Ryzen 7 8745HS w/ Radeon 780M Graphics
grep -m1 'model name' /proc/cpuinfo    : Intel(R) N95
grep -m1 'model name' /proc/cpuinfo    : AMD Ryzen 5 PRO 2400GE w/ Radeon Vega Graphics

Offline

#5 Today 07:29:11

Whoracle
Member
Registered: 2010-11-02
Posts: 176

Re: Pacman pull-through cache

I was eyeing Pacoloco, since it gets the cache warming and house keeping bonus points, but for now I went with plain NGINX, since I'm running that to serve my own repo anyways. Gonna leave this open over the weekend and then mark it solved.

Offline

Board footer

Powered by FluxBB