DNF not listing installed packages

,

DNF is currently not correctly showing my installed packages. Is there a way to get it to “refresh” and search for what is installed? This is the current output of dnf list installed, which is clearly not showing everything:

Installed Packages
fedora-gpg-keys.noarch                                                           39-1                                                      @fedora 
fedora-release.noarch                                                            39-36                                                     @updates
fedora-release-common.noarch                                                     39-36                                                     @updates
fedora-release-identity-basic.noarch                                             39-36                                                     @updates
fedora-repos.noarch                                                              39-1                                                      @fedora 
filesystem.x86_64                                                                3.18-6.fc39                                               @fedora 
setup.noarch                                                                     2.14.4-1.fc39                                             @fedora

Check the output:

rpm -q -a | wc -l
dnf repoquery --installed | wc -l
rpm -q -a | wc -l
133
dnf repoquery --installed | wc -l
132

The reason the number is different from the previously listed packages is because I just installed speedtest-cli which then installed about 100 dependencies. If I attempt to remove speedtest-cli, it tells me the operation is not allowed because it is attempting to remove systemd.

Your package database may have become corrupted and reset for some reason.
A simple workaround is reinstalling the relevant package group:

sudo dnf --allowerasing group install kde-desktop-environment
1 Like

One quick question before I try this: I am on the KDE spin of Fedora Workstation. Do I need to modify anything in your commands?

This seems to have worked, dnf is behaving normally. Thanks for your help!

1 Like