How do I install a package without installing the whole group?

Solution 1:

I can confirm that running sudo apt install lxdm pulls in many dependencies (I tried it in Ubuntu MATE focal but not in Xubuntu, but all focal packages are the same).

After running apt-cache show lxdm I see that lxdm Recommends: lxde-common, desktop-base and in turn lxde-common Recommends: lxde-core, lxde-session, lxpanel, lstask, lxrandr, lxsession-logout, lxlock, gnome-screenshot. Each of these has its own dependencies too, and you do end up installing the entire LXDE.

The solution is to run it like this:

sudo apt install --no-install-recommends lxdm

which will result in only single package lxdm to be installed.