Why is paccache not recognized as a command?

This command in the linked instructions is not recognized on my desktop but is on my laptop. Both were up-to-date prior to this most recent 3/30 updates; and both are KDE Plasma and Kernel 6.12 on stable branch.

Any idea how I can figure out why? Thank you.

sudo paccache -ruk0

Do you have the pacman-contrib package installed? It contains paccache & quite a few other useful utilities::

pacman -Ql pacman-contrib

pacman-contrib /usr/bin/checkupdates
pacman-contrib /usr/bin/paccache
pacman-contrib /usr/bin/pacdiff
pacman-contrib /usr/bin/paclist
pacman-contrib /usr/bin/paclog-pkglist
pacman-contrib /usr/bin/pacscripts
pacman-contrib /usr/bin/pacsearch
pacman-contrib /usr/bin/pacsort
pacman-contrib /usr/bin/pactree
pacman-contrib /usr/bin/rankmirrors
pacman-contrib /usr/bin/updpkgsums
3 Likes

Thank you. You’re correct, I didn’t have that package installed.

2 Likes

If you run paccache -rvuk0 you’re prompted for privilege using polkit only when needed - it’s more transparent and follows the principle of least privilege… though it might be more convenient to use sudo for scripts.

You could also think about adding a pacman hook to automate the cleanup.

# /etc/pacman.d/hooks/cleanup.hook
[Trigger]
Operation = Upgrade
Operation = Install
Operation = Remove
Type = Package
Target = *

[Action]
Description = Cleaning up package cache...
When = PostTransaction
Exec = /usr/bin/paccache -rvuk0
2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.