But I'm worried that the desktop services might still be running unnecessarily
Unless you have autologin enabled, it would just be the display manager, which implements the GUI login page. This probably does not occupy more than 50-100 MB of memory, which, since it won't see any action, is liable to be swapped out when needed (and I'd guess a large chunk of it will be shared by things that are in real use).
However, it is pretty easy to disable without uninstalling anything,1 and much of it is likely to be a dependency of stuff you do want anyway):
sudo systemctl set-default multi-user.target
First check systemctl get-default
to make sure it is currently graphical.target
, which is what it should be if a GUI is running. However, at least at some point in the past desktop Raspbian was (wrongly) configured to always use multi-user.target
, and just added the display manager to that.
Hopefully that has changed.2 If not, try:
sudo systemctl mask lightdm
This is a ham-fisted version of disable
(see man systemctl
); lightdm
is the aforementioned display manager. In any case, probably just switching to multi-user.target
, which is intended for non-graphical console login, should be enough.
I do not think they make micro SD cards small enough to worry about removing it, by which I mean the base X server + the display manager + LXDE (the desktop environment). However, there still could be a ton of GUI application stuff. But unless you are tight for space don't worry about it; in any case I don't think you will really be able to trim more that 0.5 or so GB.
I always use Raspbian lite but sometimes install a desktop afterward (that's never default enabled), so I don't have a "full version" image here to check.