Remove graphical desktop packages from Debian image

I’m totally out of space (100%) disk usage on my Debian image flashed to a 4GB SD card for a Beaglebone White. Is there an easy way to remove all of the desktop oriented packages for users who are using these in a headless maner?

I started to poke around the installed packages with various dpkg -l scripts, but was wondering if such a collection already existed (on a wiki somewhere?).



sudo apt-get remove lxqt-* xserver* --purge

But there's a lot of extra cruft..

For next time, take a look at:

iot image: