//更换源(建议先更换源再安装桌面等包)
$ sudocp -p /etc/apt/sources.list /etc/apt/sources.list.bak
$ sudo vim /etc/apt/sources.list //编辑文件
==========分割线==========#阿里云源
deb http://mirrors.aliyun.com/ubuntu-ports eoan main restricted
deb http://mirrors.aliyun.com/ubuntu-ports eoan-updates main restricted
deb http://mirrors.aliyun.com/ubuntu-ports eoan universe
deb http://mirrors.aliyun.com/ubuntu-ports eoan-updates universe
deb http://mirrors.aliyun.com/ubuntu-ports eoan multiverse
deb http://mirrors.aliyun.com/ubuntu-ports eoan-updates multiverse
deb http://mirrors.aliyun.com/ubuntu-ports eoan-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu-ports eoan-security main restricted
deb http://mirrors.aliyun.com/ubuntu-ports eoan-security universe
deb http://mirrors.aliyun.com/ubuntu-ports eoan-security multiverse
==========分割线==========
$ sudoapt-get update -y //更新包
$ sudoapt-get upgrade -y //更新系统
//启用root
$ sudopasswd root //设置root密码
$ sudo vim /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
#添加以下两行信息:
greeter-show-manual-login=true
all-guest=false
$ sudo vim /etc/pam.d/gdm-autologin //注释掉以下行
#auth required pam_succeed_if.so user != root quiet_success
$ sudo vim /etc/pam.d/gdm-password //注释掉以下行
#auth required pam_succeed_if.so user != root quiet_success
$ su root //切换到root
# vim .profile //编辑.profile
把mesg n ||true 修改为 tty -s && mesg n ||true
//重启系统即可
//设置开机启动自定义内容
# vim /lib/systemd/system/rc.local.service==========分割线==========##添加内容到末尾[Install]
WantedBy=multi-user.target
Alias=rc.local.service
==========分割线==========# ln -s /lib/systemd/system/rc.local.service /etc/systemd/system/rc.local //创建rc.local的软链接# touch /etc/rc.local //新建rc.local文件,内容如下==========分割线==========#!/bin/sh -e## rc.local## This script is executed at the end of each multiuser runlevel.# Make sure that the script will "exit 0" on success or any other# value on error.## In order to enable or disable this script just change the execution# bits.## By default this script does nothing.exit 0
==========分割线==========# chmod +x /etc/rc.local //添加执行权限# systemctl enable rc.local //开机自启
//重启设备验证