- How to remove a protected package
- How to make dnf remove a protected package
- How to fix “protected package” on Fedora
- How to remove the GNOME desktop with dnf
This is a very common problem. Thanks @vgaetera for the command.
As Fedora Discussion is very well indexed, I would like to put this here.
NOTE
Make sure you exit to a “TTY” before removing a desktop!
Do this by pressing Ctrl
Alt
F3
after logging out, or when being at the initial login screen.
Example command to remove a single protected package:
sudo dnf remove gnome-shell --setopt protected_packages=
Command to open a dnf shell with custom parameters, do the changes and exit with run
:
sudo dnf shell -y --setopt protected_packages=
Automated, this can look like:
sudo dnf shell -y --setopt protected_packages= << EOI
swap fedora-release-workstation fedora-release-kde
swap fedora-release-identity-workstation fedora-release-identity-kde
run
remove @gnome-desktop
run
remove *gnome* *gtk*
run
install @kde-desktop-environment
run
EOI
sudo systemctl restart sddm.service
This would remove the GNOME Desktop and replace it with the KDE Plasma Desktop, without reinstalling.