Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
How can I restart my GUI (X window server) from command line without rebooting the system? Which process(es) do I need to kill and do they automatically restart?
All you need to do is restart LightDM as root, like so:
sudo restart lightdm
This worked for me:
sudo service lightdm restart
The worst is that noone mentioned that you must use alt+ctrl+F1 to F6 to switch to terminal. Login there as standard user. Restart x with sudo command and then press alt+ctrl+F7 to go back to GUI.
On Ubuntu 18.04, I do this executing next command:
sudo systemctl restart lightdm
Required, but never shown