Fedora KDE 39 » 40 upgrade & wayland-only debloat tips

I just upgraded a laptop with traditional Fedora from F39 to F40.

Lets say… atomic distro upgrades work worlds easier, one run, done. This took a few reboots and strange repititions.

Fedora KDE (unlike Kinoite) comes equipped with a ton of KDE apps so I debloated as many of them as possible. Future apps will be mostly installed as Flataks. This speeds up upgrades and reduces the chance for breakages.

sudo dnf remove kontact akregator kaddressbook dragon contactthemeeditor elisa kmag kmail kmoustool kgpg kmahjongg kmines kmouth konversation kolourpaint okular korganizer kpatience ktnef krdc korganizer kamoso qdbusviewer libreoffice* sieveeditor im-chooser vlc kwin-x11 sddm-x11 kate orca kamera zenity gwenview qemu-guest-agent spice-vdagent abrt-addon-xorg qt5-qtsensors pulseaudio-qt-qt5 qt5-qttranslations

sudo dnf autoremove

sudo dnf --refresh upgrade

Wow, that was a lot! Let’s install the Flatpaks instead:

flatpak install -y gwenview okular libreoffice haruna thunderbird kamoso

Now do the upgrade, following this guide

After the upgrade, just to be extra extra sure:

# sync all packages (how is this different from upgrade?)
sudo dnf --refresh distro-sync

# rebuild rpm configs
sudo dnf install rpmconf
sudo rpmconf -a

# remove packages from old release (should not be needed)
sudo dnf install remove-retired-packages

# remove duplicates
sudo dnf remove --duplicates

# remove unneeded packages
sudo dnf autoremove

# remove packages with no repo
sudo dnf remove $(sudo dnf repoquery --extras --exclude=kernel,kernel-\*)

I thought Fedora KDE would remove the X11 stuff, but it didnt?

Note: many qt5 and even x11 packages need to be kept, as they are hard dependencies of the desktop or other components. :melting_face:


Hello @boredsquirrel , interesting idea. Did you know autoremove actually doesn’t refresh the metatdata for dnf after completion. As per the doc’s

This command by default does not force a sync of expired metadata

You should probably force refresh the metadata after autoremove and before doing the next dnf operation. I suppose a distro-sync might be appropriate way.

As a side note, I was thinking of writing an article for the :fedora: Magazine about the installed sizes of the editions and variants and spins and labs, just to show how different this distro can be.

1 Like

I did not use dnf a lot.

Is there a single command that refreshes the metadata and removes all packages that are not needed?

sudo dnf --refresh autoremove


I was merely pointing out that after using the command you would have stale metadata so remember to force refresh on the next command in your process to lighten your install. But you can be more specific with what you autoremove too if you desire, and dnf check is good to try occasionally.

1 Like

This sounds as if dnf autoremove would leave metadata in a stale state in which it wasn’t before. This is not true.

dnf autoremove updates the local metadata as per the actions it executes, of course. What it doesn’t do is “updating” (refreshing) the local cache of remote repository data. By default, dnf does this based on expiration time, and you can force it any time with the default dnf option --refresh.


Thanks for the clarification!