I've installed debian with gnome desktop, I like using gnome so I don't want to change into other desktop environment such as lxde or fxce. I'm also install the system in a virtual machine, so I want the system to be slimmer.

I want to uninstall programs such as libreoffice, games and some other software, however, it seems that can cause big problems, suppose I want to remove libreoffice: sudo apt purge libreoffice. It seems this command will also remove the entire gnome desktop.

In summary, I'm asking the way to remove the programs I don't want while keep a proper working gnome environment.

enter image description here


Removing LibreOffice won’t remove the entire GNOME desktop. This used to be the case, but since at least Debian 9 (Stretch), metapackages are handled specially to avoid this scenario. The gnome package is a metapackage, as indicated by its presence in the “metapackages” section. When such a package is removed for dependency reasons, as happens when you remove the libreoffice package, all the metapackage’s other dependencies are marked as manually installed, which means they won’t be auto-removed.

You can verify this yourself, as follows. The output you show in your question indicates that apt will remove libreoffice and all its dependencies, and the gnome metapackage but none of its dependencies. Before you do that, run

apt-mark showmanual > ~/manual-pre-removal.txt

Now remove libreoffice (it’s safe), and run

apt-mark showmanual > ~/manual-post-removal.txt

Comparing the two files with

meld ~/manual-pre-removal.txt ~/manual-post-removal.txt &

will show that all the other GNOME packages have been marked as manually installed.

Thus to slim down your GNOME installation in Debian, you can remove the packages corresponding to applications you don’t use. As long as you keep gnome-core installed, you’ll still have a functional GNOME desktop.


The gnome package is a Debian metapackage. Its description says:

This metapackage depends on the standard distribution of the GNOME desktop environment, plus a complete range of plugins and other applications integrating with GNOME and Debian, providing the best possible environment to date.

The Gnome metapackage has dependencies on several LibreOffice packages, hence when you remove the libreoffice metapackage, the gnome metapackage is marked for removal as well. From the apt output it looks like no other gnome package, which is not related to LibreOffice, is removed, so removing gnome metapackage should not be an issue.

  1. Solution without system reinstall: You could uninstall the whole Gnome desktop by typing apt-get --purge autoremove gnome. Afterwards restart the system and it will boot into a command line interface (CLI) without any desktop environment. Then continue at step 3.

  1. Solution with system reinstall: You could reinstall your whole system and hereby avoid automatic installation of a bloated desktop environment by skipping the desktop environment selection prompt of the installer. Afterwards your system will boot into a command line interface (CLI) without any desktop environment. Now continue at step 3.

  1. When reaching the command line interface (CLI) after reboot, you can setup Gnome without any additional accessoires by typing apt-get install gnome-core. This will install a clean and lightweight Gnome desktop environment without any unwanted bloatware.
  • 1
    No need to re-install, that’s way overkill! – Stephen Kitt Oct 4 '18 at 18:11
  • @StephenKitt: That is true of course! Thanks for your hint! – Dave Oct 4 '18 at 18:20
  • 1
    That’s still overkill. For one thing, as alluded to in sebasth’s answer, removing libreoffice causes gnome’s removal, but because that’s a metapackage, that doesn’t then result in the removal of all its other dependencies. For another, you don’t need to remove all of GNOME to re-install only parts of it; you can mark gnome-core as manually installed before removing gnome, which avoids all the messing around with rebooting etc. – Stephen Kitt Oct 4 '18 at 20:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.