天天看點

ubuntu 18.0安裝桌面

在指令環境下運作如下指令: 

#更新軟體庫
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