remove gdm/gdm3 from Ubuntu 16.04

How to remove gdm/gdm3 (GNOME Desktop) from Ubuntu 16.04/14.04?

Remove gdm/gdm3 from Ubuntu 16.04 or 14.04 using these simple terminal commands.

Uninstall gdm

sudo apt-get remove gdm

To uninstall gdm3

sudo apt-get remove gdm3

Remove gdm/gdm3 from Ubuntu 16.04 and it’s dependent packages

sudo apt-get remove --auto-remove gdm

To uninstall gdm3 and it’s dependent packages

sudo apt-get remove --auto-remove gdm3

Purging gdm

sudo apt-get purge gdm

To purge gdm3

sudo apt-get purge gdm3

To delete configuration and/or data files of gdm and it’s dependencies from Ubuntu Xenial then execute:

sudo apt-get purge --auto-remove gdm

or

sudo apt-get purge --auto-remove gdm3

Hope this helps. Cheers!