Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
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.
| Category | Requirements, Conventions or Software Version Used |
|---|---|
| System | Ubuntu 26.04 Resolute Raccoon – Download |
| Software | GDM3 (GNOME Display Manager), optionally SDDM or LightDM; at least two desktop environments installed (e.g., GNOME, KDE Plasma, XFCE, MATE) |
| Other | Privileged 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 |
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.

| Step | Command/Action |
|---|---|
| 1. Check current DE | echo $XDG_CURRENT_DESKTOP |
| 2. List available sessions | ls /usr/share/xsessions/ /usr/share/wayland-sessions/ |
| 3. Change system-wide default | sudo update-alternatives --config x-session-manager |
| 4. Verify after reboot | echo $XDG_CURRENT_DESKTOP |
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 Environment | Package | Session Name | Character |
|---|---|---|---|
| GNOME (default) | ubuntu-desktop | ubuntu / gnome | Modern, streamlined, activity-based workflow |
| KDE Plasma | kde-plasma-desktop | plasma | Highly customizable, traditional desktop layout |
| XFCE | xfce4 | xfce / xfce-wayland | Lightweight, fast, low resource usage |
| MATE | mate-desktop-environment | mate | Traditional 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.
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:
| Desktop Environment | Package | Session Name | Character |
|---|---|---|---|
| GNOME (default) | ubuntu-desktop | ubuntu / gnome | Modern, streamlined, activity-based workflow |
| KDE Plasma | kde-plasma-desktop | plasma | Highly customizable, traditional desktop layout |
| XFCE | xfce4 | xfce / xfce-wayland | Lightweight, fast, low resource usage |
| MATE | mate-desktop-environment | mate | Traditional GNOME 2 fork, simple and stable |
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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, plasma, xfce, mate, or gnome.
Edit the AccountsService user file: Open the configuration file for your user account:
$ sudo nano /var/lib/AccountsService/users/linuxconfig
Locate 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.
Reboot to apply the change:$ sudo rebootAfter rebooting, GDM will read the updated AccountsService file and automatically log you into the specified desktop environment.
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:
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.
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.
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.
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.
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
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.
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
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.
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.
