Ubuntu GNOME 桌面不是很穩定經常發生卡死的情況以下幾種方法可以在不重啟的條件下恢復桌面
Method 1 -X11 restart
- Alt+F2
- 按r
- 會話自動重啟
Method 2 -Wayland restart
Wayland 是一個新的display協議,Gnome Shell 所支持的,基本上支持所有的主流GPU
Ctrl + Alt + F3 登錄TTY
出現Login的話 需要輸入你的賬戶名和密碼
sudo systemctl stop gdm
# 如果你使用的是LightDM 則執行
sudo systemctl stop lightdm
# 接下來執行
sudo systemctl start gdm
# 如果你使用的是LightDM 則執行
sudo systemctl start lightdm
Method 3 -Display 替代
如果Method 1 和 Method 2 兩種方法都對你無效那么請嘗試第三種方法
利用 Gnome Shell 內建的 replace 函數
Ctrl + Alt + F3 登錄TTY
出現Login的話 需要輸入你的賬戶名和密碼
touch gnome-restart
echo '#!/bin/bash' > gnome-restart
echo 'DISPLAY=:0 gnome-shell --replace &' >> gnome-restart
sudo chmod +x gnome-restart
sudo mv gnome-restart /usr/bin/
gnome-restart