How to Change Default Desktop Environment on Ubuntu 26.04

Changing the default environment on Ubuntu 26.04 allows you to tailor your desktop experience to match your workflow and preferences. Whether you prefer the polished look of GNOME, the customizability of KDE Plasma, or the lightweight efficiency of XFCE, Ubuntu makes it straightforward to switch between installed desktop environments. In this tutorial, you will learn how to change the default desktop environment on Ubuntu 26.04 using both the graphical login screen and the command line, and how to ensure your choice persists across reboots.

Software Requirements

CategoryRequirements, Conventions or Software Version Used
SystemUbuntu 26.04 Resolute Raccoon – Download
SoftwareGDM3 (GNOME Display Manager), optionally SDDM or LightDM; at least two desktop environments installed (e.g., GNOME, KDE Plasma, XFCE, MATE)
OtherPrivileged access to your Linux system as root or via the sudo command.
Conventions# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

TL;DR

To change the default environment on Ubuntu 26.04, select a different session from the GDM login screen gear icon, or use the command line for system-wide changes.

StepCommand/Action
1. Check current DEecho $XDG_CURRENT_DESKTOP
2. List available sessionsls /usr/share/xsessions/ /usr/share/wayland-sessions/
3. Change system-wide defaultsudo update-alternatives --config x-session-manager
4. Verify after rebootecho $XDG_CURRENT_DESKTOP

Understanding Desktop Environments on Ubuntu 26.04

A desktop environment (DE) is the graphical interface layer that sits on top of the Linux kernel and system services. It provides everything you interact with visually: the panel, application menu, window manager, file manager, system settings, and more. Consequently, the desktop environment you choose has a significant impact on your daily workflow, resource usage, and overall experience.

Ubuntu 26.04 ships with GNOME as its default desktop environment. However, you can install additional desktop environments and switch between them freely. The most popular options available in the Ubuntu 26.04 repositories include:

Desktop EnvironmentPackageSession NameCharacter
GNOME (default)ubuntu-desktopubuntu / gnomeModern, streamlined, activity-based workflow
KDE Plasmakde-plasma-desktopplasmaHighly customizable, traditional desktop layout
XFCExfce4xfce / xfce-waylandLightweight, fast, low resource usage
MATEmate-desktop-environmentmateTraditional GNOME 2 fork, simple and stable

Each desktop environment relies on a display manager (DM) to present the login screen and launch the chosen session. Ubuntu 26.04 uses GDM3 (GNOME Display Manager) by default. Other display managers include SDDM (commonly used with KDE Plasma) and LightDM (a lightweight cross-desktop option). Only one display manager can be active at a time on your system.

Checking Your Current Default Environment

Before making any changes, it is useful to identify which desktop environment is currently active on your Ubuntu 26.04 system. Additionally, you should verify which sessions are installed and available for selection. Open a terminal and run the following commands:

  1. Check the active desktop environment: Run the following command to display the name of your current DE:$ echo $XDG_CURRENT_DESKTOPOn a default Ubuntu 26.04 installation, this will output ubuntu:GNOME. If you are running KDE Plasma, it will show KDE, and XFCE will display XFCE.
  2. Check the session type: To determine whether you are running a Wayland or X11 session, use:$ echo $XDG_SESSION_TYPEThe output will be either wayland or x11. Ubuntu 26.04 defaults to Wayland for GNOME sessions. For more details on Wayland configuration, see how to set Wayland as default on your system.
  3. List all available desktop sessions: Desktop sessions are defined by .desktop files stored in two directories. List them with:$ ls /usr/share/xsessions/ /usr/share/wayland-sessions/Each filename (without the .desktop extension) represents a session you can select at the login screen. Note that XFCE appears in both directories: xfce-wayland.desktop under Wayland sessions and xfce.desktop under X11 sessions, which means you can run XFCE under either display protocol. MATE, on the other hand, only provides an X11 session, while KDE Plasma is available exclusively as a Wayland session.
  4. Check the current display manager: To identify which display manager is handling your login screen:$ cat /etc/X11/default-display-managerOn a default Ubuntu 26.04 system, this returns /usr/sbin/gdm3.
How to Change Default Desktop Environment on Ubuntu 26.04
How to Change Default Desktop Environment on Ubuntu 26.04 3

Changing the Default Environment Using the Login Screen

The simplest way to change your default environment on Ubuntu 26.04 is through the GDM login screen. This method requires no command-line interaction and is therefore ideal for users who prefer a graphical approach.

  1. Log out of your current session: Save all your work, then log out from the system menu in the top-right corner of the GNOME desktop. Alternatively, you can log out from the terminal:$ gnome-session-quit –logout –no-prompt
  2. Select your username on the login screen: On the GDM login screen, click on your username to select it. Do not enter your password yet.
  3. Open the session selector: After selecting your user, look for a gear icon in the bottom-right corner of the login screen. Click this gear icon to reveal a list of all available desktop environments.
  4. Choose a different desktop environment: Select the desktop environment you want to use from the dropdown list. For example, choose “Plasma (Wayland)” for KDE Plasma, “Xfce Session” for XFCE, or “MATE” for the MATE desktop.
  5. Enter your password and log in: Type your password and press Enter. The selected desktop environment will load instead of the previous default.

IMPORTANT
GDM remembers your last selected session on a per-user basis. This means that once you select a desktop environment, it will automatically be used for all future logins until you change it again. Each user on the system can therefore have a different default desktop environment without affecting others.

How to Change Default Desktop Environment on Ubuntu 26.04
How to Change Default Desktop Environment on Ubuntu 26.04 4

Changing the Default Environment via Command Line on Ubuntu 26.04

For system-wide changes or when working on a headless system, you can change the default environment on Ubuntu 26.04 using command-line tools. There are several approaches depending on your specific needs.

Method 1: Using update-alternatives

The update-alternatives system manages symbolic links for default applications on Ubuntu, including the session manager. This method changes the system-wide default for all users.

  1. List available session managers: First, check which session managers are registered on your system:$ sudo update-alternatives –list x-session-managerThis will output paths to available session managers, such as /usr/bin/gnome-session/usr/bin/startplasma-wayland, or /usr/bin/startxfce4.
  2. Select a new default session manager: Run the interactive configuration command:$ sudo update-alternatives –config x-session-managerYou will see a numbered list of all available session managers. Enter the number corresponding to your preferred desktop environment and press Enter. For instance, to switch to KDE Plasma, select the entry pointing to /usr/bin/startplasma-wayland.

Method 2: Editing AccountsService Configuration

Ubuntu’s display manager (GDM) uses AccountsService to store per-user session preferences. You can modify this directly to set a specific user’s default desktop environment without logging through the GUI.

  1. Identify available session names: List the session files to find the exact session name you need:$ ls /usr/share/wayland-sessions/ /usr/share/xsessions/Note the filename without the .desktop extension. For example, plasmaxfcemate, or gnome.
  2. Edit the AccountsService user file: Open the configuration file for your user account:$ sudo nano /var/lib/AccountsService/users/linuxconfigLocate the [User] section and set or modify the Session and XSession keys:[User] Session=plasma XSession=plasma Icon=/home/linuxconfig/.face SystemAccount=falseReplace plasma with the session name that matches your desired desktop environment. Save the file and exit nano with Ctrl+O followed by Ctrl+X.
  3. Reboot to apply the change:$ sudo rebootAfter rebooting, GDM will read the updated AccountsService file and automatically log you into the specified desktop environment.

Method 3: Changing the Display Manager

If you want to switch the display manager itself (for example, from GDM to SDDM for better KDE Plasma integration), you can use dpkg-reconfigure:

  1. Reconfigure the display manager: Run the following command to open the display manager selection dialog:$ sudo dpkg-reconfigure gdm3A dialog will appear listing all installed display managers. Use the arrow keys to highlight your preferred display manager (e.g., sddm for KDE Plasma or lightdm for a lightweight option) and press Enter to confirm.
  2. Reboot your system: The change takes effect after a reboot:$ sudo reboot

DISPLAY MANAGER PAIRINGS
Common pairings are: GDM3 with GNOME, SDDM with KDE Plasma, and LightDM with XFCE or MATE. While any display manager works with any desktop environment, using the paired manager typically provides better integration and theming.

Making the Change Permanent

When you change the default environment on Ubuntu 26.04 through the GDM login screen, GDM automatically stores your selection in the AccountsService database. This means your choice persists across reboots without any additional configuration. However, understanding how this persistence works can help you troubleshoot issues and manage multi-user systems.

The per-user session preference is stored in /var/lib/AccountsService/users/. Each user has a configuration file in this directory. To verify your stored preference:

$ sudo cat /var/lib/AccountsService/users/linuxconfig

The Session key shows the session that GDM will load by default for that user. If you changed the system-wide default using update-alternatives, this affects the fallback session used when no per-user preference is set.

For a system-wide default that applies to all users who have not set a personal preference, you can also create a custom GDM configuration. Create or edit the following file:

$ sudo nano /etc/gdm3/custom.conf

Under the [daemon] section, add or modify:

[daemon]
DefaultSession=plasma.desktop

Replace plasma.desktop with the session file name corresponding to your preferred desktop environment. After making changes, restart GDM or reboot:

$ sudo reboot

COMPLETED
After rebooting, verify the change was successful by opening a terminal and running echo $XDG_CURRENT_DESKTOP. The output should reflect your newly selected desktop environment.

Troubleshooting Common Issues

Switching desktop environments does not always go smoothly. Here are some common issues you might encounter after changing the default environment on Ubuntu 26.04 and how to resolve them.

Desktop environment not appearing on the login screen

If a newly installed desktop environment does not appear in the GDM session selector, the session .desktop file may be missing. Verify that the session file exists:

$ ls /usr/share/xsessions/ /usr/share/wayland-sessions/

If the session file is not present, the desktop environment package may not have installed completely. Try reinstalling it:

$ sudo apt install --reinstall kde-plasma-desktop

Additionally, you may need to restart the display manager for the new session to appear:

$ sudo systemctl restart gdm3

Session falls back to GNOME after reboot

If your session reverts to GNOME after a reboot, check the AccountsService configuration for your user:

$ sudo cat /var/lib/AccountsService/users/linuxconfig

Make sure the Session key is set to the correct session name. If it keeps resetting, another process may be overwriting it. In that case, ensure you are not running any login scripts that reset the session variable.

Black screen or login loop after switching

A black screen or login loop can occur if the selected desktop environment has unmet dependencies or conflicting packages. To recover, switch to a virtual terminal by pressing Ctrl+Alt+F3 and log in with your credentials. Then, reset the session to GNOME:

$ sudo nano /var/lib/AccountsService/users/linuxconfig

Change the Session value back to ubuntu and reboot. You can also try reconfiguring the display manager:

$ sudo dpkg-reconfigure gdm3

Display manager conflict

When multiple desktop environments are installed, each may install its own display manager. If you experience unexpected behavior, verify which display manager is active:

$ cat /etc/X11/default-display-manager

If the wrong display manager is set, reconfigure it using the method described in the previous section. Furthermore, your default firewall configuration should not interfere with display manager operation, but ensure no rules are blocking local connections if you encounter unusual issues.

Conclusion

Changing the default environment on Ubuntu 26.04 is a flexible process that can be accomplished through either the graphical login screen or the command line. The GUI method via the GDM gear icon is the quickest approach for individual users, while the command-line methods using update-alternatives and AccountsService provide greater control for system administrators and automated setups. Regardless of the method you choose, Ubuntu’s AccountsService ensures your preference persists across reboots. If you encounter issues, the troubleshooting steps covered in this tutorial should help you recover and get your preferred desktop running smoothly. For further information, refer to the official Ubuntu documentation on switching desktop environments.

Frequently Asked Questions

  1. Can I have multiple desktop environments installed at the same time on Ubuntu 26.04? Yes, you can install as many desktop environments as you like on a single Ubuntu 26.04 system. Each one will appear as an option in the login screen session selector. They share the same underlying system and user files, so you can switch freely between them without losing data. However, keep in mind that multiple DEs will consume additional disk space and may occasionally introduce minor theming conflicts.
  2. Will changing my desktop environment affect my files and applications? No, switching the desktop environment does not modify your personal files, installed applications, or system configuration. Your documents, downloads, and application data remain intact. However, some desktop-specific settings (such as panel layout or keyboard shortcuts) are stored separately for each DE, so those will differ between environments.
  3. How do I completely remove a desktop environment I no longer need? To remove an unwanted desktop environment, first ensure you are logged into a different DE. Then use sudo apt remove followed by the meta-package name (e.g., sudo apt remove kde-plasma-desktop). Afterward, run sudo apt autoremove to clean up orphaned dependencies. You may also want to reconfigure your display manager if the removed DE’s display manager was active.
  4. What is the difference between changing the session at the login screen and using update-alternatives? The login screen method changes the default session for a single user only. GDM stores this preference in AccountsService and remembers it for future logins. The update-alternatives method, on the other hand, changes the system-wide default session manager. This affects the fallback session used when no per-user preference is configured, making it useful for setting defaults on multi-user systems.

Leave a Reply

Your email address will not be published. Required fields are marked *