You are not logged in.

#1 2018-12-06 10:47:40

Shino
Member
Registered: 2015-02-01
Posts: 47

Use pacman cache as local package mirror

Hello,

I have several Arch installations running at my home, including my main tower PC. Unfortunately, my internet connection is not the best and large updates are very annoying.
After a vacation or any other longer time span of no updates, I usually update one of my PCs and sometimes copy the package cache of this updated PC to my other computers over LAN.
In this case I only have to download the updates a single time.

I wanted to ask, if it is possible to somehow share the package cache of my main machine in the network, so my other machines can download the packages locally from this machine. During an update, pacman should search the package list of my local mirror first. However, if this package is not installed on my main machine, or the machine is not reachable, I want it to download the package from a standard mirror in the internet.

Is something like this achievable or do you have another more practical solution for this? Manually copying the package cache is not very convenient.


Thank you

Offline

#2 2018-12-06 11:16:58

sincomil
Member
Registered: 2018-02-13
Posts: 77

Re: Use pacman cache as local package mirror

Yes you can.
Use repo-add command to create local package cache file and add its path to pacman.conf as custom section. MOAR Info

Offline

#3 2018-12-06 15:18:06

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 2,533

Re: Use pacman cache as local package mirror

No, that will not stay up to date with the official repos. DO NOT DO THIS.

Use the very next tip on that page, which discusses how to share the package cache between multiple computers or serve a mirror with both the official dbs (containing matched packages) and the currently available package cache, while falling back to regular mirrors.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#4 2018-12-07 10:24:05

Shino
Member
Registered: 2015-02-01
Posts: 47

Re: Use pacman cache as local package mirror

Thank you for your replies. I will try it.

EDIT:

I tried it and it work. However, for each package that is not present on my local mirror, pacman throws a 404 error. Can I somehow supress this error?

Last edited by Shino (2018-12-07 18:26:26)

Offline

#5 2018-12-09 04:33:06

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 2,533

Re: Use pacman cache as local package mirror

If you use a (networked?) shared CacheDir, then pacman won't try to download it at all.

If you use something like pacserve, then the pacserve machine will proxy all packages, downloading them the first time you try to retrieve it, then cacheing it and returning the cached version for all the machines on your local network.

The "quick" solution is very often not the "best" solution, and indeed this is the case here as well. The "Network shared pacman cache" tip has several subsections to choose a cache method that suits you best.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB