Ubuntu: How to completely remove the gui. Desktop to server version.
I just had to remove the package xserver-xorg-core.
$ apt-get remove xserver-xorg-core
Then you should do a complete system reboot.
$ reboot
Now your system will start into the command line interface (cli)