Uninstallation of Ubuntu 22.04 GUI

If you want to uninstall the GUI on Ubuntu, you can follow these steps:

Enter the terminal interface: Press Ctrl+Alt+F3 (or other F1-F6) to switch to the terminal interface, and then log in with your username and password.

Stop the GUI: Enter the following command in the terminal to stop the running GUI process:

sudo service gdm stop

Note: This command is for systems using GDM (GNOME Display Manager) as the login manager. If you are using other login managers, such as LightDM or SDDM, you should replace "gdm" in the command with the corresponding login manager name accordingly.

Uninstall the desktop environment: Enter the following command to uninstall the desktop environment and its related components:

sudo apt-get remove ubuntu-desktop

Note: This command will uninstall GNOME, the default desktop environment of Ubuntu. If you are using other desktop environments, such as KDE, Xfce or LXDE, you should replace "ubuntu-desktop" in the command with the corresponding desktop environment name accordingly.

Delete related configuration: Enter the following command to delete the configuration files of the desktop environment and related software:

sudo apt-get purge ubuntu-desktop

Note: This command will delete configuration files for the desktop environment and its associated software, including custom configuration files and user data. You can skip this step if you wish to keep these configuration files.

Clean up unnecessary dependencies: Enter the following command to clean up dependencies and temporary files that are no longer needed:

sudo apt-get autoremove

This command will remove dependencies and temporary files that are no longer needed, freeing up disk space.

Restart the system: Enter the following command to restart the system:

sudo reboot

After the system restarts, the graphical interface will no longer run, you can use the command line interface in the terminal.

Guess you like

Origin blog.csdn.net/m0_52537869/article/details/130448505