How to restart GUI on Ubuntu 22.04 Jammy Jellyfish

Occasionally the need to restart the GUI (desktop environment) on Ubuntu 22.04 Jammy Jellyfish arise. This usually happens whenever you encounter an unexpected error or your GUI gets “hung up”.

The objective of this tutorial is to provide an Ubuntu user with a few alternative ways how to restart / refresh GUI (graphical user interface) on Ubuntu 22.04 Jammy Jellyfish.

In this tutorial you will learn:

  • How to restart GUI on Ubuntu 22.04
Restarting GUI on Ubuntu 22.04 Jammy Jellyfish
Restarting GUI on Ubuntu 22.04 Jammy Jellyfish
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Ubuntu 22.04 Jammy Jellyfish
Software gnome-shell
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

How to restart GUI on Ubuntu 22.04 step by step instructions




Sometimes you many need to restart/reload GUI because you may have done some changes which require it. However, occasionally you are forced to restart GUI because it froze and you do not wish to restart the entire system. In any case you might find some of the below information helpful.

  1. The first method is the least destructive, however, it might not provide the expected result. While logged in to your GNOME desktop press ALT + F2 key combination. Into the Enter a Command box type r and press Enter. Note that this method does not work on Wayland.
    Restarting GNOME GUI through the command menu
    Restarting GNOME GUI through the command menu
  2. Another alternative to do the GUI restart trick might be the most obvious to simply re-login.
    Log out and back in, in order to restart the GUI
    Log out and back in, in order to restart the GUI
  3. In this scenario we simply restart the gnome-shell as non-privileged user by entering the following command in terminal.
    $ gnome-shell --replace
    
    Restarting the GNOME GUI via command line
    Restarting the GNOME GUI via command line
  4. The following restart GUI solution is guaranteed to restart your desktop even if your GUI froze while the system is still functioning. However, it needs administrative sudo privileges. Enter the following command in terminal:


    $ sudo systemctl restart systemd-logind
    
    Restarting the GUI through systemd
    Restarting the GUI through systemd

    Either enter the sudo systemctl restart systemd-logind command directly into the terminal while in GUI. However, if your GUI is frozen you may need to first change to TTY console using CTRL + ALT + F2, login and execute command from there.

  5. In this method we will restart the Display Manager which will consequently also restart GNOME shell. Enter the following command:
    $ sudo systemctl restart gdm
    
    Restarting gdm
    Restarting gdm

    Either from GUI and TTY console CTRL + ALT + F2 execute sudo systemctl restart gdm command. However, if you have deployed LightDM display manager in that case execute sudo systemctl restart lightdm command.

Closing Thoughts




In this tutorial, we saw how to restart the GUI on Ubuntu 22.04 Jammy Jellyfish Linux. Restarting the GUI can save you from having to do a complete system reboot when troubleshooting a system issue or making a change that requires a GUI refresh. Use whichever of the methods work best for your situation.