You are not logged in.
Hi,
I have looked at some AUR helpers and they cache the built packages below a user
~/.cache ...directory and not in
/var/cache/pacman/pkg/I don't understand the reasoning for this. Since, the packages get installed system-wide, so why are the built packages not cached system-wide?
This way in principle different users can install packages, but then they do have different built package caches. While both users install on the same system.
If, otherwise, the packages would be cached in a single location
/var/cache/pacman/pkg/all users (with appropriate access rights) would have access to all installed packages.
Offline
$ ls -l /var/cache/pacman/
total 604
drwxr-xr-x 2 root root 614400 5 jan 10:47 pkg
$ The only user that has write access there is root .
I know packages from my custom local repo that are installed with pacman -S are cached.
When using pacman -U to install though I doubt anything is cached .
TL;DR :
setup your own custom local repo or use a helper like aurutils that does that for you.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Thanks. So the helpers (I looked at) us pacman -U, which is not copying the package either?
I know copying to pacman's cache would require root access rights, but that is also true for installing the package anyway.
I guess there is a reason why pacman -U does not do it? So it may be a bad idea to do it by myself?
Offline
Understanding, that `pacman -U` has nothing to do with AUR, may be the first step to seeing why it doesn’t copy files to cache.
Shortly: because they’re not being downloaded.
Paperclips in avatars? | Sometimes I seem a bit harsh — don’t get offended too easily!
Offline
I don't understand the reasoning for this. Since, the packages get installed system-wide, so why are the built packages not cached system-wide?
aur helpers are ran under your user, not with escalated privs as say the root user, the aur helpers themselves pull down the pkgbuild into those cache directories and build with makepkg. the distinction here is that while downloading/pulling down packages you are running pacman escalated as root, where as the aur helper is preferably not as its just a wrapper around makepkg and pacman themselves and it does not really need escalation itself but rather the tooling its calling does.
also escalating your aur helper to root level would just cause makepkg to panic since it already has a check if its being ran as root and quits if so
Offline
But what would speak against having pacman copying locally installed packages to it's cache, too?
Offline
Mandatory read: https://wiki.archlinux.org/title/Arch_User_Repository
Deceiving users by blurring the lines between repos and AUR is a cardinal sin of all pacman wrapping AUR helpers and you have to be aware of its implications.
AUR packages aren't cached at all because they're locally built anyway.
"pacman -U" just installs a random uri - what or where that is, is of no further interest. In this case it's a file that makepkg has just built and your AUR helper has randomly used a path called ~/.cache as build location.
Your AUR helper (not pacman) *could* then move the packages it has build into some global cache path, but
1. that's always gonna be specific to the particular AUR helper
2. since makepkg will not run as root, the package cannot be built in that path, so *moving* it there would cause makpkg to always rebuilt (existing) packages
all users (with appropriate access rights) would have access to all installed packages.
All users with appropriate access rights *have* access to all installed packages - installing a package requires root privileges. The root has access to everything.
Also if a package was installed by user A there's no point for user B to install the exact same package again?
Offline
Thanks for the informative discussion.
Actually in my case I have two accounts, one local and the other gets access rights via Kerberos and the local root does not have access to files that other user builds on a mounted openafs filesystem..
But anyway, I think I'm starting to get the point and it is actually not a big deal for me to cope with this. I only need to be disciplined and always use a local user for installation/update etc.
Thanks again.
Offline
pacman -U with a URLwill download a package to the cache. e.g.
pacman -U file:///home/allan/packages/mint-check-translations/mint-check-translations-1.5.0-1-x86_64.pkg.tar.zstI think the default Arch pacman.conf would require that package to be signed.
Offline