For months I’ve noticed that doing dnf update
has been very slow with the disk thrashing around for 5 to 10 minutes. I thought I might have been having disk problems but the SMART reports showed no problem. Today, on a whim, I thought to rebuild the rpm database. … bingo its fixed, no more thrashing around and updates complete in a few seconds. I guess the database can get into a bad state that’s not quite bad enough to fail (or to give an error notice).
Hum! I never did that before. Had many problems in the past with the slowness of DNF, but never recall doing that, probably would’ve save a bunch o headaches. I would be good to share the commands used.
On Fedora 40 DNF4 got decent speeds with the Drop Delta RPMs and probably Do not download filelists by default. But definitely is/was (it seems to have improved) a slow package manager even with the dns-makecache service enabled.
DNF5 is definitely faster. Let’s see how it will perform from F41 on.
It is simply …
$ sudo rpm --rebuilddb
hehehe. Checked my history and I used it few times in the past. Maybe following the Post upgrade tasks from dnf system upgrade.
I can confirm that rebuilding the rpm database can improve performance. I have seen this on my older and slower system with the old Berkeley-DB based database. Especially listing the installed packages would be affected, for example when you used rpm -qa
or dnf list installed
.