You are not logged in.
Been running an Arch system for a couple years now and a few times I've had to 'clean' the package cache with `pacman -Sc`.
I noticed it said it will keep just what I currently have installed, and that got me wondering, "Why?" -- what do I need the package files for my currently installed packages for?
Docs say that I can pass `-Scc` to nuke the whole thing -- any reason not to do that following every successful update?
Thanks in advance!
Offline
Files for the currently installed packages are becoming files for previously installed packages upon an update. If something goes wrong, you may use them to roll back the update. Without the cache you need a working internet connection to for that and, unless you wish to manually guess and reconstruct URLs, a working browser.
If building own packages, having the needed packages in cache avoids constant downloads for makedepends. With a fast connection this may not be troublesome to you, but it puts pointless load on volunteer-provided mirrors.
Package pacman-contrib has a tool called paccache. It gives more fine-grained control over package cache cleaning. You may take a look at it. May serve you better than raw -Sc/-Scc.
Last edited by mpan (2026-01-13 04:18:12)
Paperclips in avatars? | Sometimes I seem a bit harsh — don’t get offended too easily!
Offline
I use a tmpfs as cachedir and explicitly install frequently required makedepends to implicitly maintain the cache and reduce disk IO
(If you were to use an AUR helper and use it to install an AUR package that depends on more aur package and all have the same makedepend and the AUR helper is sufficiently dumb, you might end up installing/removing the makedepend a couple of times in the effort)
Offline
Another advantage of the pkg cache is it holds the unchanged default versions of config files.
When troubleshooting it can be very handy to be able to compare your custom config with the original version.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Alternatively, keep everything forever!
$ du -hxd0 /var/cache/pacman/pkg
283G /var/cache/pacman/pkg
$ ls -lt /var/cache/pacman/pkg | tail -1
-rw-r--r-- 1 root root 24240 May 1 2011 python2-cairo-1.10.0-1-x86_64.pkg.tar.xzSakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
OP never returned, but interesting thread. Guess we all manage things our own way.
I find no need for pkg cache, let alone a museum. However, that's a mighty impressive collection @WorMzy!
No devtools, or even base-devel, installed on my Arch hosts. And certainly no builddeps/makedepends either.
All build action takes place in a clean chroot or nspawn container.
I do not use AUR packages in general other than a couple -bins. Any non-repo packages I maintain via my own PKGBUILDs.
Offline
Another advantage of the pkg cache is it holds the unchanged default versions of config files.
When troubleshooting it can be very handy to be able to compare your custom config with the original version.
This is a very good reason that I haven't heard before. I'm convinced.
Offline