4rch-linux/usr/share/ezarcher/Docs/auto-cache-clean.txt
2026-04-28 23:32:38 +02:00

37 lines
1,005 B
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Managing the package cache
check how many cached packages are available in my cache folder.
$ sudo ls /var/cache/pacman/pkg/ | wc -l
check the total disk space used by the cache folder.
$ du -sh /var/cache/pacman/pkg/
Automatically clean the package cache using pacman hooks.
To do so, create a file /etc/pacman.d/hooks/clean_package_cache.hook:
$ sudo mkdir /etc/pacman.d/hooks
$ sudo nano /etc/pacman.d/hooks/clean_package_cache.hook
Add the following lines:
[Trigger]
Operation = Upgrade
Operation = Install
Operation = Remove
Type = Package
Target = *
[Action]
Description = Cleaning pacman cache...
When = PostTransaction
Exec = /usr/bin/paccache -rk 1
Save and close the file.
From now on, the package cache will be cleaned automatically after every pacman transactions (like upgrade, install, remove).
You don’t have to run paccache command manually every time.
# Revision: 2022.04.22 -- by eznix (https://sourceforge.net/projects/ezarch/)
# (GNU/General Public License version 3.0)