You are not logged in.
When installing a package with -U, pacman doesn't cache packages as it does when installing with -S. Is there a way to change this behavior?
I read somewhere that specifying the package's full path and prepending "file://", as in "pacman -U file://path/to/package.pkg.tar.xz", but this often complains of an "invalid or corrupted package (PGP signature)".
How can I make pacman always copy installed packages to the cache?
MOD EDIT: change 'closed' to 'solved' in title to avoid confusion
Last edited by fukawi2 (2013-07-06 13:09:21)
Offline
You can't. This has been discussed on the bugtracker several times.
https://bugs.archlinux.org/task/35699
https://bugs.archlinux.org/task/31243
https://bugs.archlinux.org/task/15143
https://bugs.archlinux.org/task/18012
If you're building the packages yourself with makepkg, you can set PKGDEST to your cache in makepkg.conf. Otherwise you could write a small pacman wrapper that copies the package after installing it.
Offline
I have a folder which I use to build packages from the AUR. If I wanted, I could easily copy the built packages manually e.g.
find ~/apps -name "*pkg.tar.gz" -exec cp '{}' ~/test/foo/ \;Offline
pacman() {
case $1 in
-U) cp $2 /var/cache/pacman/pkg/; /usr/bin/$@ ;;
*) /usr/bin/$@ ;;
esac
}"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
If you're building the packages yourself with makepkg, you can set PKGDEST to your cache in makepkg.conf.
I think that's what I'll do.
Offline
'Please edit the title and change 'closed' to 'solved'. 'Closed' means it has been locked by the moderators.
https://wiki.archlinux.org/index.php/Fo … ow_to_Post
Last edited by karol (2013-07-06 13:05:13)
Offline
pacman() { case $1 in -U) cp $2 /var/cache/pacman/pkg/; /usr/bin/$@ ;; *) /usr/bin/$@ ;; esac }
The only problem I can see with this is that there is the possibility that you might be installing something like a split package, so in this case only the first listed package would go. Also, it doesn't give you the option to use something like "pacman -U --asdeps <package>" (which I think is used sometimes by makepkg itself).
Offline
True, I've never used such a function - I was just brainstorming how it could be done. That could be cleaned up to address those concerns.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline