Ubuntu安裝桌面環境

在命令環境下運行以下命令:

  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

保存後重啓便可完美在桌面環境登錄rootshell

相關文章
相關標籤/搜索