Skip to content

Instantly share code, notes, and snippets.

@jzbor
Last active October 11, 2022 13:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jzbor/19dfb272fa64769552720f999b132829 to your computer and use it in GitHub Desktop.
Save jzbor/19dfb272fa64769552720f999b132829 to your computer and use it in GitHub Desktop.
Pacman hooks to clean old package cache
# /etc/pacman.d/hooks/paccache_outdated.hook
[Trigger]
Operation = Upgrade
Operation = Install
Operation = Remove
Type = Package
Target = *
[Action]
Description = Cleaning pacman cache (outdated versions)
When = PostTransaction
Exec = /usr/bin/paccache -rk3
Depends = pacman-contrib
# /etc/pacman.d/hooks/paccache_uninstalled.hook
[Trigger]
Operation = Upgrade
Operation = Install
Operation = Remove
Type = Package
Target = *
[Action]
Description = Cleaning pacman cache (uninstalled packages)
When = PostTransaction
Exec = /usr/bin/paccache -ruk0
Depends = pacman-contrib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment