You are not logged in.

#1 2026-01-13 03:57:53

askreet
Member
Registered: 2010-01-16
Posts: 10

Package Cache - do I need it?

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

#2 2026-01-13 04:16:48

mpan
Member
Registered: 2012-08-01
Posts: 1,566
Website

Re: Package Cache - do I need it?

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

#3 2026-01-13 08:44:27

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,876

Re: Package Cache - do I need it?

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

#4 2026-01-13 11:25:20

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,733

Re: Package Cache - do I need it?

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

#5 2026-01-13 12:33:26

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,294
Website

Re: Package Cache - do I need it?

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.xz

Sakura:-
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

#6 2026-01-21 18:53:15

tekstryder
Member
Registered: 2013-02-14
Posts: 493

Re: Package Cache - do I need it?

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

#7 2026-01-23 23:38:42

mson
Member
Registered: 2026-01-23
Posts: 1

Re: Package Cache - do I need it?

Lone_Wolf wrote:

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

Board footer

Powered by FluxBB