I am using Ubuntu 19.04 (Disco Dingo). My question is the same as this old one: How to restart X Window Server from command line?
However, the much upvoted answer there does not work for me. When I run sudo systemctl restart display-manager
as suggested there, the window system is restarted but then after that I cannot login, it seems like the window system is restarted again at each login attempt. So then I anyway need to reboot to make things work again. So that does not achieve what I want. What I would like is to be able to restart the window system without doing a full system reboot.
The other suggestion in the old answer was to check which display manager is used by doing cat /etc/X11/default-display-manager
(in my case this gives /usr/sbin/gdm3
) and then run sudo restart gdm
but that gives me an error message: sudo: restart: command not found
.
Is there a way to restart the X window system in Ubuntu 19.04 without doing a full reboot, and be able to login again afterwards?
Edit: I also tried systemctl restart gdm
but that gives the same problem as sudo systemctl restart display-manager
-- the window system is restarted but after that I cannot login, need to reboot to make things work again.
You can try:
This old Q&A: How to restart GNOME Shell from command line? may have the answers for you.
Initially these used to work for people:
r
then ↵.gnome-shell --replace
.Now days this seems to be the only solution:
killall -3 gnome-shell
.Note: This Q&A focuses on restarting gnome display manager without loosing all work and going back to Login screen.
What does Alt+F2 do?
From: 13 Keyboard Shortcut Every Ubuntu 18.04 User Should Know