How Does Downloading and Updating Packages Work with Pacman?

I updated my system from 21.1.3 to 24.0.0 on May 18 20:00 using pacman -Syu. The total download size was 4GB.
The following day I restored to an earlier point before the update(May 18 18:00) using timeshift

Today(May 27) I ran the same command. To my surprise the total download size was 68mb which was for firefox.

Which leads me to believe update files for packages are stored somewhere? I am really curious how pacman works. I mean the system had fully updated and any update files should have been gone.

1 Like

They are–in /var/cache/pacman/pkg/.

Please see:

3 Likes

All the package bundles are held in /var/cache/pacman/pkg as you’ll see if you look in there. You may need to configure pacman to limit the number of versions of each package it keeps, unless you want to risk running out of space on whatever filesystem you have that on. You can configure this with pamac-manager, click on the hamburger menu and select preferences. Keeping more than one version can be handy as it means you can downgrade packages if for any reason the latest version of something causes problems. Though you should be careful doing this in case you cause compatibility problems with other packages (such as libraries).

It’s actually very handy having this cache; I keep two bootable images on different physical SSDs. Having a separate /var/cache filesystem that’s shared between the two images means once I’ve updated one I don’t need to download everything again if I want to update the other one.

3 Likes

Ah, thank you!

Oh that’s pretty neat. I just checked, mine is 22.6GB. Glad I never found out how to clear the cache when I was scrambling for storage. Would have hated redownloading the whole 4GB again.

If you need info how you update the right way for this big update: