If you planned to install a CentOS server, but mistakenly also installed Desktop Environment such as GNOME, you can easily remove the GUI packages and return back to Command Line (CLI).
There are two ways to do that. You can simply disable GUI or completely uninstall it. I will provide steps to do both.
Disable GUI (GDM)
nano /etc/inittab
change id:5:initdefault: to id:3:initdefault:
Remove GUI
If you want to remove all GUI packages completely, please still use the disable GUI steps first otherwise once Gnome, GDM, X Windows removed CentOS will still try to load X Window.
To remove GUI packages follow the steps:
yum groupremove "GNOME Desktop Environment" -y yum groupremove "X Window System" -y
If you want to temporarily stop GDM (GUI), you can issue this command:
init 3
and then back to start GDM:
init 5