I cannot add much to what the other shave suggested, other than perhaps
the steps I would take to do this:

1. Backup the box, preferably when offline to avoid any open file issues
(I do not know what you have on the box, so those may not matter).
2. Oft-missed: test (restore) the backup somewhere isolated. Be sure it
works since a broken backup is no backup at all.
3. Do the steps others mentioned; you will probably have it uninstalling
a lot of stuff, but that's the point, right? The GUI patterns should not
have software which is relied-upon by lower-level stuff, so the things
removed may be things like LibreOffice, which is not technically part of
the X11 or Gnome pattern, but which depend on it, and also need to go.
Things like 'bash' and 'kernel' and 'glibc' should not show up, and if
they do you s should stop, or be prepared to use that backup.

Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below.

If you want to send me a private message, please let me know in the
forum as I do not use the web interface often.