在命令環境下運行如下命令:
#更新軟件庫
sudo apt-get update
#升級軟件
sudo apt-get upgrade
#安裝Ubuntu桌面系統
#安裝時間有點長,需要耐心等待。
sudo apt-get install ubuntu-desktop
reboot重啓後發現桌面環境不能使用root賬戶登錄.
#重啓然後使用Ctrl + Alt + F1 進入命令行使用root登陸
#運行命令
#打開50-ubuntu.conf
sudo vi /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
#在末尾添加
#允許切換用戶登陸
greeter-show-manual-login=true
#禁用Guest
allow-guest=false
完整代碼
[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