1. 步驟
- 安裝軟件
- 修改root權限
- 重啟
2. 詳情
1. 安裝軟件
創建腳本文件(例如:desktopSetting.sh),並輸入以下內容:
#!/bin/bash #更新軟件庫 apt-get update #升級軟件 apt-get upgrade #安裝ubuntu桌面系統 apt-get install ubuntu-desktop
2. 修改root權限
2.1 修改 /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf 如下:
[Seat:*] user-session=ubuntu greeter-show-manual-login=true allow-guest=false
2.2 修改/root/.profile如下:
a.修改前:
# ~/.profile: executed by Bourne-compatible login shells. if [ "$BASH" ]; then if [ -f ~/.bashrc ]; then . ~/.bashrc fi fi mesg n || true
b.修改后:
# ~/.profile: executed by Bourne-compatible login shells. if [ "$BASH" ]; then if [ -f ~/.bashrc ]; then . ~/.bashrc fi fi tty -s && mesg n || true