6

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?

6

All you need to do is restart LightDM as root, like so:

sudo restart lightdm
| improve this answer | |
  • 1
    You should probably mention that you should do this from a TTY (virtual terminal). – RolandiXor Sep 16 '16 at 17:19
  • I was guessing from the level of detail of the question that Mr. Wolf knows his way around the terminal. :) – Fred Rocha Sep 16 '16 at 18:15
  • 1
    I wasn't just referring to the "terminal", but oh well. (I said virtual for a reason. I mean the thing you get when you press ctrl+alt+f-key-of-your-choice). – RolandiXor Sep 17 '16 at 22:30
  • Oh, I see. And what would the advantage be in this case? How would that work? Curious myself now. :) – Fred Rocha Sep 18 '16 at 12:35
5

This worked for me:

sudo service lightdm restart
| improve this answer | |
1

On Ubuntu 18.04, I do this executing next command:

sudo systemctl restart lightdm
| improve this answer | |
1

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.