DNF cache at 27GB

Noticed I was running low on disk space so performed a disk usage analysis. Apparently /var/cache/dnf/ holds 27GB of diskspace. Expanding the directory further, these five items appear to be exceptionally large:

What should I do about this? I tried running these commands:

sudo dnf clean packages
sudo dnf clean dbcache
sudo dnf clean all
sudo dnf autoremove

But it barely made a difference.

Hi and welcome to :fedora:

sudo dnf4 clean all
The dnf5 cache is at /var/cache/libdnf5

1 Like

Hi and thanks for the reply! That seems to have done the trick!
But I do not fully understand why though? Could you elaborate a bit?

That with the dnf cache files you can also check in the config with:
dnf4 config-manager --dump |grep cache till F40
From F41 on dnf --dump-main-config |grep cache

We where changing from dnf4 to dnf5 (this are the package names).
The command names have been sim-linked to the older commands.

Fedora switched to dnf5 with f41 which would’ve changed the cache directory among other things. It can still get a little confusing because both KDE Discover and Gnome Software are still utilizing dnf4.

Change:
https://fedoraproject.org/wiki/Changes/SwitchToDnf5

dnf5 documentation:
https://dnf5.readthedocs.io/en/latest/

1 Like