I’d like to ask is it possible to switch entirely to KDE from Gnome in all aspects, in means of completely removing Gnome and installing KDE since I tried removing gnome and the system refused since gnome-shell is a protected package.

I want someone who tried such a thing and tell me about the experience and I have some concerns doing that… and my main concern if that step worked is about the Nvidia drivers having a hybrid Machine which requires Optimus drivers…does it work well in KDE or shall I just stick to Gnome with X11 for now?

Thanks in adavnce

You can use Fedora spins:
https://spins.fedoraproject.org/

Fedora spins of KDE desktop environment:
https://spins.fedoraproject.org/kde/

Also you can download various types of desktop environment
https://download-ib01.fedoraproject.org/pub/fedora/linux/releases/37/Spins/x86_64/iso/

A little bit guidance here:

By the way, Fedora is using Wayland by default for their display server instead of X11. And you can change the server by logining out the Fedora then at the login screen, select the “gear” icon and select GNOME on Xorg. Once login is completed the X11 windowing system will be in use, as can be seen by returning to Settings > About. This change will persist unless changed back at the login screen.

Or you can use this method also:

Yes, here’s a script that replaces GNOME with KDE:

tee migrate-gnome-kde.sh << EOF > /dev/null
#!/usr/bin/bash
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
EOF

You can run it from a text terminal Alt+Ctrl+F3:

sh migrate-gnome-kde.sh

Otherwise you can remove protected packages like this:

sudo dnf remove gnome-shell --setopt protected_packages=
9 Likes

That was the answer I was looking for…Thank you so much. However, I still have the concern of running KDE wirh my optimus drivers. Is it better than gnome or as easy? if you had any experience in that topic I’d appreciate you explaining the situation for me.

In KDE (just as in GNOME) the default is Wayland, but there is a choice at the login prompt to use X11 instead.
Wayland is not compatible with some of the proprietary Nvidia drivers (I switched to AMD months ago, so I no longer keep detailed track of Nvidia issues, but I don’t think it has changed much).
I don’t know about optimus. But I still expect any problems would be in Wayland, not in KDE.

If you are worried about KDE working or you are worried you won’t like it, you could install and try KDE before removing GNOME (so you can use either by choice at the login screen).

I expect almost any change in Desktop Environment will initially feel worse, because it is not what you are used to. But in my opinion, KDE is much better than GNOME.

Just run ‘dnf install plasma-desktop’ and switch with gdm. There are a few desktops you can see with ‘dnf list *desktop’. Gnome is the default setup of Fedora like Red Hat and CentOS, you might have to remove this and that …

This solution was perfect for me. Wanted to replace Gnome by KDE on my laptop with Fedora 40. Just forgot to run the script outside my current Gnome session. While the script was running, the laptop rebooted to a CLI screen where I had to run the script again to install the new DE. After the switch, I lost my Brave Browser !?

Two days before I tried to install KDE while keeping the Gnome DE. All things was really slow (both KDE and Gnome sessions). But with your script to replace Gnome all is good and fast.

I suppose that with the first commands of your script, a future release upgrade (to Fedora 41) will use the “spin” release and upgrade with KDE and not Gnome DE ?

Each upgrade should upgrade the installed packages and not revert to some past configuration. This would mean that if your system is stable, has done the full dnf upgrade --refresh as is always prompted when updating with dnf system-upgrade, and has the kde DE already working, then the upgrade should not change those conditions.

Note that the ‘spin’ installed/active has nothing to do with what happens when doing an upgrade. The upgrade works at the package level only.

1 Like

Thank you for taking the time to clarify all this. Much appreciated.

If deciding to dump gnome desktop completely is there a way to cleanup users home drive?

A more modern script:

#!/usr/bin/bash

# GNOME to KDE Migration Script
# Description: Safely migrates from GNOME to KDE Plasma desktop environment
# Warning: This will remove GNOME and install KDE. Backup important data first.

set -euo pipefail

# Color codes for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'

# Logging functions
log_info() {
    echo -e "${GREEN}[INFO]${NC} $1"
}

log_warn() {
    echo -e "${YELLOW}[WARNING]${NC} $1"
}

log_error() {
    echo -e "${RED}[ERROR]${NC} $1"
}

# Check if running as root
if [[ $EUID -eq 0 ]]; then
    log_error "This script should not be run as root. It will use sudo when needed."
    exit 1
fi

# Confirm with user
echo "This script will:"
echo "1. Replace Fedora workstation packages with KDE variants"
echo "2. Remove GNOME desktop environment"
echo "3. Install KDE Plasma desktop environment"
echo "4. Switch to SDDM display manager"
echo ""
echo -e "${YELLOW}WARNING: This is a destructive operation. Backup your important data first!${NC}"
echo -e "${RED}Some applications might be removed. The system should remain functional but review changes carefully.${NC}"
echo ""

read -p "Do you want to continue? (type 'yes' to continue): " confirmation

if [[ $confirmation != "yes" ]]; then
    log_info "Migration cancelled by user."
    exit 0
fi

# Verify DNF is available
if ! command -v dnf &> /dev/null; then
    log_error "DNF package manager not found. This script is for Fedora systems."
    exit 1
fi

# Create backup
BACKUP_FILE="$HOME/package-list-backup-$(date +%Y%m%d-%H%M%S).txt"
log_info "Creating package list backup at: $BACKUP_FILE"
rpm -qa --queryformat "%{NAME}\n" | sort > "$BACKUP_FILE"

log_info "Starting migration from GNOME to KDE..."

# Step 1: Replace release packages
log_info "Step 1: Replacing Fedora release packages..."
sudo dnf swap -y fedora-release-workstation fedora-release-kde
sudo dnf swap -y fedora-release-identity-workstation fedora-release-identity-kde

# Step 2: Remove GNOME desktop group
log_info "Step 2: Removing GNOME desktop environment..."
sudo dnf group remove -y "GNOME Desktop Environment"

# Step 3: Install KDE
log_info "Step 3: Installing KDE Plasma desktop..."
sudo dnf group install -y "KDE Plasma Workspaces"

# Step 4: Clean up - SAFER approach for GNOME packages
log_info "Step 4: Cleaning up GNOME packages (safe mode)..."
# Only remove explicitly installed GNOME packages, not dependencies
sudo dnf remove -y $(dnf repoquery --userinstalled --queryformat "%{name}" | grep -E '^(gnome|nautilus|gnome-shell|gdm)') 2>/dev/null || true

# Step 5: Install recommended KDE applications
log_info "Step 5: Installing recommended KDE applications..."
sudo dnf install -y \
    dolphin \
    konsole \
    kate \
    spectacle \
    gwenview \
    okular

# Clean up orphaned packages
log_info "Cleaning up orphaned packages..."
sudo dnf autoremove -y

# Configure display manager
log_info "Configuring display manager..."
if ! sudo dnf list installed sddm &>/dev/null; then
    sudo dnf install -y sddm
fi

# Disable GDM if it exists
if systemctl is-active gdm &>/dev/null; then
    sudo systemctl disable gdm --now
fi

sudo systemctl enable sddm --now

log_info "Migration completed successfully!"
echo ""
log_warn "Important notes:"
echo "1. Please REBOOT your system to complete the migration"
echo "2. Your package backup is at: $BACKUP_FILE"
echo "3. Some GNOME applications might still be available if manually installed"
echo "4. If you have issues, check SDDM service status: systemctl status sddm"
1 Like
Failed to resolve the transaction:
No match for argument: KDE Plasma Workspaces

Did you do some special config to make this script work?

That script uses the syntax for dnf4. The commands probably should be changed to be appropriate for dnf5.
To see the appropriate group names for dnf5 use dnf group list and the dnf5 syntax uses the name in the first column of that output. Dnf4 uses the second column.

Example.
gnome-desktop GNOME Desktop Environment yes

# Step 2: Remove GNOME desktop group
log_info "Step 2: Removing GNOME desktop environment..."
sudo dnf group remove -y "GNOME Desktop Environment"

would be changed to
sudo dnf remove -y @gnome-desktop
or to use the dnf4 syntax change it to read
sudo dnf4 group remove -y "GNOME Desktop Environment"

1 Like