edit1: hooks should be placed at /etc/pacman.d/hooks/ and must have .hook as extension. edit2: you can also use paccache to remove cached aur packages if you specify the directory with -c. It's slightly harder since different helpers use different folders. --dry-run is useful here while you try to figure things out.
I really wish this hook was included in pacman by default. It's something all users are going to have to add, and as you can see by these comments, not enough people know about it.
Like, having a default hook doesn't make it any less customizable. It just makes it so it fits the majority of user's needs, instead of nothing at all which is going to fit very few user's needs.
I usually keep 3 versions, but even if you've deleted all of them downgrade works with a remote archive so you'll be fine until the archive disappears.
Well it depends on the criticality of the system. I have arch installed on my work machine so I want to be able to rollback a package if it makes my machine unstable and hinders my work. But if it's a personnal one it's totally acceptable I think.
Depends on whether he has btrfs snapshots. I just cd into my preupgrade or weekly snapshots and pacman -U the downgrade I need; if the package is installed but not in cache on the snapshot, just chroot and use bacman to generate a package first. Or if it breaks on boot, just boot into a prior snapshot, chroot into the broken one and then fix it that way.
Btrfs snapshots are like cheating. I hope that BTRFS either finally gets considered stable or another next gen filesystem becomes stable.
I'm on a Windows machine at work, I was curious on the options so I google "man paccache" to check out the man page and try the command when I get home. Google decides I meant to search "man package", filling the top of my search results page with pictures of gorgeous men in underwear showing off their male attributes. Turns out there's no man page, it's a script and should have searched for it in the Arch Wiki.... Lesson learned
FWIW - I have two pacman hooks that I really like, one of them is the aforementioned hook that removes old cached packages, and another updates my mirrors using reflector.
[Trigger]
Operation = Upgrade
Type = Package
Target = pacman-mirrorlist
[Action]
Description = Updating pacman-mirrorlist with reflector and removing pacnew...
When = PostTransaction
Depends = reflector
Exec = /usr/bin/env sh -c "reflector --country 'United States' --age 12 --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist; if [[ -f /etc/pacman.d/mirrorlist.pacnew ]]; then rm /etc/pacman.d/mirrorlist.pacnew; fi"
63 comments
pacman hooks. This will leave the last 3 installed and the last uninstalled.
edit1: hooks should be placed at
/etc/pacman.d/hooks/and must have.hookas extension.edit2: you can also use paccache to remove cached aur packages if you specify the directory with
-c. It's slightly harder since different helpers use different folders.--dry-runis useful here while you try to figure things out.TIL, never heard about user pacman hooks before, thanks
alpm-hooks(5)I really wish this hook was included in pacman by default. It's something all users are going to have to add, and as you can see by these comments, not enough people know about it.
Like, having a default hook doesn't make it any less customizable. It just makes it so it fits the majority of user's needs, instead of nothing at all which is going to fit very few user's needs.
I didn't know you could add hooks to pacman. That's really neat.
sudo nano /usr/share/libalpm/hooks/mine-clear-paccache.hook
.
Then insert your hook
.
Anything else I should do/know about it? :o
hooks should be placed at
/etc/pacman.d/hooks/and must have.hookas extension.Were am I supposed to add this ?
hooks should be placed at
/etc/pacman.d/hooks/and must have.hookas extension.Well, I just found out about paccache thanks to your post and cleared up 13.78 GiB...
I see someone isn't running on a 100GiB SSD!
I usually do rm -f /var/cache/pacman/pkg/*
This is not so clever ;)
And now you can't temporarily rollback a package if you need to
With https://archive.archlinux.org/, it's not really as necessary to keep a cache locally.
Unless netctl or networkmanager borks ;)
Or systemd, wpa_supplicant, iptables2, dialog,...
Well...I run this after pretty much every update so I didn't have a version to roll back to anyway :P
Guess I should stop running it with
-k0I usually keep 3 versions, but even if you've deleted all of them downgrade works with a remote archive so you'll be fine until the archive disappears.
Well it depends on the criticality of the system. I have arch installed on my work machine so I want to be able to rollback a package if it makes my machine unstable and hinders my work. But if it's a personnal one it's totally acceptable I think.
I've had good experiences with
downgradein these cases, even when not cached locally.Depends on whether he has btrfs snapshots. I just cd into my preupgrade or weekly snapshots and pacman -U the downgrade I need; if the package is installed but not in cache on the snapshot, just chroot and use bacman to generate a package first. Or if it breaks on boot, just boot into a prior snapshot, chroot into the broken one and then fix it that way.
Btrfs snapshots are like cheating. I hope that BTRFS either finally gets considered stable or another next gen filesystem becomes stable.
Ahem...
Maybe I should do this once in a while...
RKO them packages out of here
Watch out watch out watch out.
I'm on a Windows machine at work, I was curious on the options so I google "man paccache" to check out the man page and try the command when I get home. Google decides I meant to search "man package", filling the top of my search results page with pictures of gorgeous men in underwear showing off their male attributes. Turns out there's no man page, it's a script and should have searched for it in the Arch Wiki.... Lesson learned
Haha lol.
Next time you could try searching
paccache(1)orpaccache(8)if you knew what section it would be in. But yeah there isn't a man page in this case.That's why you should always add "Arch" or "Arch Linux" to your search term ;)
Amateur
Wouldn't it be sensible to make -rk3 a default behaviour?
It is. From the help page:
Ah, what do you know ¯\_(ツ)_/¯ Thanks!
Okay. Let's ask the important qurstions here. What Terminal Font are you using?
Iosevka Term
Thank you! Its beautiful!
FWIW - I have two pacman hooks that I really like, one of them is the aforementioned hook that removes old cached packages, and another updates my mirrors using reflector.