在命令環境下運行如下命令:
apt-get update //更新軟件庫 apt-get upgrade //升級軟件 apt-get install ubuntu-desktop //安裝Ubuntu桌面系
安裝時間有點長,需要耐心等待。
reboot重啟后發現桌面環境不能使用root賬戶登錄.
重啟然后使用Ctrl + Alt + F1 進入命令行使用root登陸
運行命令
sudo vi /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf //打開50-ubuntu.conf
在末尾添加
greeter-show-manual-login=true //允許切換用戶登陸 allow-guest=false //禁用Guest
完整代碼
[Seat:*] user-session=ubuntu greeter-show-manual-login=true allow-guest=false
保存重啟(在VI模式下編輯完成后使用Esc鍵切換到末行模式,然后輸入:wq退出編輯)發現root用戶登陸后還是有警告
修改/root/.profile文件 (圖形界面下修改請勾選顯示隱藏文件)
將mesg n 替換為 tty -s && mesg n
完整代碼
# ~/.profile: executed by Bourne-compatible login shells. if [ "$BASH" ]; then if [ -f ~/.bashrc ]; then . ~/.bashrc fi fi tty -s && mesg n || true
保存后重啟即可完美在桌面環境登陸root