Method 1: No need to restart
1. Press Ctrl+Alt+F1 to enter the tty terminal
2. Enter the account number and password to log in. Note, do not use the small keyboard in this step
3. Execute the command to log off the desktop and log in again
The command is:
sudo pkill Xorg 或者 sudo restart lightdm
4. Wait for a few minutes after execution, usually it will return to normal
Method 2: Restart safely
First of all, no matter what happens to Ubuntu, never force restart
If method one doesn't work, you can try a safe restart
1. Press and hold the Ctrl and Alt keys at the same time, press and hold
2. Press the SysRq key (some keyboards are PrtSc)
3. Press the R key once
4. Press the E key once
5. Press the I , S , U , B keys in sequence
Once these steps are complete, the system will reboot safely