You are not logged in.

#1 2013-07-04 21:25:07

nbtrap
Member
Registered: 2011-02-24
Posts: 110

[SOLVED] Make Pacman cache packages installed with -U

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

#2 2013-07-04 22:39:22

apg
Developer
Registered: 2012-11-10
Posts: 211

Re: [SOLVED] Make Pacman cache packages installed with -U

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

#3 2013-07-05 11:32:42

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Make Pacman cache packages installed with -U

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

#4 2013-07-05 12:19:38

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,459
Website

Re: [SOLVED] Make Pacman cache packages installed with -U

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

#5 2013-07-06 12:30:41

nbtrap
Member
Registered: 2011-02-24
Posts: 110

Re: [SOLVED] Make Pacman cache packages installed with -U

apg wrote:

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

#6 2013-07-06 13:04:32

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Make Pacman cache packages installed with -U

'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

#7 2013-07-06 14:27:12

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Make Pacman cache packages installed with -U

Trilby wrote:
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

#8 2013-07-06 14:30:04

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,459
Website

Re: [SOLVED] Make Pacman cache packages installed with -U

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

Board footer

Powered by FluxBB