Question about cleaning memory

My root partition is now on 5GB free - out of 30GB.
I am looking at two folders
one /var/cache/pacman/pkg/ being 1.3GB
The other /var/log/journal/9627e4170f594d059a9f3c81be12a25a which is 2.9
What will happen if I simply delete the content of these files?


sudo journalctl --vacuum-size=100M

Fantastic command.
Just cleared 2.7G

Now I need to address the /var/cache/pacman/pkg/ folder. I suppose this is some sort of chache of packages but is it necessary?
This cache is full with pairs of files:

linux-6.1.1.arch1-1-x86_64.pkg.tar.zst			      xfconf-4.18.0-1-x86_64.pkg.tar.zst
linux-6.1.1.arch1-1-x86_64.pkg.tar.zst.sig		      xfconf-4.18.0-1-x86_64.pkg.tar.zst.sig
linux-atm-2.5.2-8-x86_64.pkg.tar.zst			      xfsprogs-6.0.0-2-x86_64.pkg.tar.zst

and many more such pairs of .zst and .sig.
So are these files necessary?

This is the software package (zst) paired with the corresponding signature file (sig). But the sig files are really small.

pacman automatically keeps the last 2(?) versions of a package in the cache directory. This makes it easy and fast to downgrade a packge to the previous version if need be.

It is save to delete all content of /var/cache/pacman/pkg/

But you could also have a look at the paccache utility provided by the the pacman-contrib package.
Or you could look at the pacman-cleanup-hook package. This is what I am using.

sudo paccache -rk3
sudo paccache -ruk0

command 1 - clear cache - leave last 3 of each package.
command 2 - clear cache of all packages not installed anymore.

Thank you.
I’ll have a look at the recommended packages.

Thank you.
I tried the paccached -ruk0 but it did not seem to make any difference.

This was new to me. Would you mind elaborating how?
I was under the impression that if the user didn’t cleared the cache or used paccache.service or some such one would end up with a whole lot of cached packages.

You are absolutely right. My fault. pacman does not delete any packages from the cache.

1 Like

Thanks for the clarification!
I thought I had missed some fundamental functionality of pacman.

the command is called “paccache”

1 Like