Okay, let's fully remove the MATE desktop environment from your Ubuntu 24.04 system and ensure the default GNOME desktop is the only one active and set as default.
-
Open a Terminal:
Press Ctrl+Alt+T or search for "Terminal" in the Activities overview.
-
Identify Installed MATE Packages:
While not strictly necessary for removal if you know the main metapackage, you can get an idea of what's installed:
dpkg -l | grep -i mate
Look for packages like ubuntu-mate-desktop, mate-desktop-environment, mate-core, etc.
-
Purge MATE Metapackages and Core Components:
This is the main step. We use purge instead of remove to also delete system-wide configuration files associated with the packages. Replace ubuntu-mate-desktop with the specific MATE metapackage you installed if you know it was different (e.g., mate-desktop-environment). ubuntu-mate-desktop is the most common one if you added MATE to standard Ubuntu later.
sudo apt purge ubuntu-mate-desktop mate-desktop-environment* mate-core mate-session-manager mate-panel* mate-applet* mate-terminal* caja* pluma* atril* engrampa* eom* marco* mate-utils* mate-sensors-applet* -y
sudo apt purge libmate* -y
sudo apt purge mate-icon-theme* mate-themes -y
- This command targets the common MATE metapackages and many core components.
- The
* acts as a wildcard to catch related packages.
purge removes packages and their configuration files.
-y automatically confirms the removal (review the list of packages APT wants to remove before running without -y if you prefer).
-
Remove Orphaned Dependencies:
After removing the main packages, there will likely be dependencies that are no longer needed.
sudo apt autoremove --purge -y
autoremove finds and removes packages that were installed as dependencies but are no longer required by any installed package.
--purge ensures their configuration files are also removed.
-
Reinstall the Default Ubuntu Desktop (Optional but Recommended):
This ensures all necessary components for the default GNOME session are present and correctly configured.
sudo apt install --reinstall ubuntu-desktop ubuntu-session gdm3
ubuntu-desktop: The metapackage for the standard Ubuntu GNOME desktop.
ubuntu-session: Provides the session files for GNOME.
gdm3: The default display manager (login screen) for Ubuntu.
-
Reconfigure the Display Manager:
Ensure GDM3 (the GNOME Display Manager) is set as the default, especially if installing MATE might have switched it to LightDM.
sudo dpkg-reconfigure gdm3
If this command presents a choice screen, select gdm3 and press Enter. If it runs without showing a screen, it likely just confirmed GDM3 is already the default.
-
Clean Up User-Specific MATE Configuration (Optional):
System-wide configs were removed with purge, but user-specific settings might remain in your home directory.
Warning: Be careful with rm -rf. Double-check the commands.
rm -rf ~/.config/mate*
rm -rf ~/.local/share/mate*
rm -rf ~/.cache/mate*
These commands remove MATE configuration, data, and cache files from your personal home directory.
-
Reboot Your System:
Apply all changes by rebooting.
sudo reboot
You have now removed the MATE desktop environment and restored the default Ubuntu GNOME desktop.