在命令环境下运行如下命令:
#更新软件库
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