4

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

1

4 Answers 4

3

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.

1

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.

0
  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.
3
  • 1
    No need to re-install, that’s way overkill! Commented Oct 4, 2018 at 18:11
  • @StephenKitt: That is true of course! Thanks for your hint!
    – Dave
    Commented Oct 4, 2018 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. Commented Oct 4, 2018 at 20:58
0

I would like to give a more practical and up-to-date answer, if you just want to reduce the amount of potentially unnecessary software that gets installed with Gnome.

I went through this process and a lot of trial and error approximately two years ago, when installing a fresh Debian 11 (Bullseye). My approach was to find a minimal set of packages that gives me an useful Desktop Environment. If I would feel that something was missing, I prefer to be be forced to install it, instead of having a lot of stuff sitting there eating disk and memory, without ever being used.

First, very important: when installing the OS, uncheck the desktop environment suggestion and any other additional software to avoid having something installed by default.

When you get the OS running, install Python first. It is a dependency of Gnome, but as Software Engineer and I don't like to have such an important piece of the system as something that was automatically installed. Same goes with ca-certificates. This step will avoid accidentally removing these packages on apt autoremove for example:

$ sudo apt install --no-install-recommends python3 ca-certificates

Then moving on to install Gnome itself. This is the subset of packages that worked for me, after many, many broken installations:

$ sudo apt install --no-install-recommends \
    gdm3 gnome-session gnome-terminal gnome-control-center gnome-screensaver

Some important details:

  • One notable missing part is a package to control audio, so you may want to include it if you need audio:
    • It used to be the pulseaudio package up to Debian 11;
    • Starting from Debian 12, it was changed to pipewire;
    • I read somewhere that pipewire is backwards compatible with pulseaudio, as long as you install pipewire-pulse and do some configuration. I haven't tried it myself and this usage is considered experimental in Debian 11;
  • To be able to control network elements from the settings menu on Gnome, you'll also need network-manager (if not yet installed) and network-manager-gnome;
  • If a window-based file manager is your thing, you may want to include nautilus.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .