Always the same number of deleted files with dnf clean all

When I use dnf clean all I always get the same number of deleted files. I my case is 103. So, if I run the command every hour, I’ll will get the same number always.

Any tip of what is wrong?

Are you running that as root?

I’m running it with sudo.

That’s strange.

Try this:
sudo dnf update

if that goes well, and you really don’t mind refreshing the cache:
sudo rm -RI /var/cache/dnf/*

then do:
sudo dnf makecache

that should put everything back in order. If you experience that scenario again, please file a bug report against dnf at https://bugzilla.redhat.com

Hello @oldcastle, welcome to the forum! Please take a minute to go through the introductory posts in the #start-here category if you’ve not had a chance to do so.

This does not necessarily mean something is wrong. Your cache includes metadata files along with package files. If you’ve not run any transactions, and so there aren’t any rpms, only the metadata files will be removed each time, which would be a constant number untill you install/remove some repositories.

3 Likes

Ok, I’ll make peace with it :slight_smile:

Plus, since I’m new, I don’t fully understand the point of using dnf clean all and when I should do it.

Thank you all.

1 Like

There are times when dnf gets confused because the cache is jumbled-up. Then you need to refresh it (e.g. conflicts in repositories. Repositories are not static … they are updated and sometimes changes in one may affect the other or your local metadata is out of sync). Sometimes the best way to make things alright is to clean everything and let dnf rebuild it all again

3 Likes

As @twohot said, one does not need to run dnf clean all in general use. The cache is rebuilt from time to time, and one can use the --refresh flag to force a refresh too.

You can read more about the command by looking for the clean sub-command in man dnf.

4 Likes