RaspberryPI 4 (4G)初次使用Ubuntu 19.10 eoan

//系统
$ lsb_release -a
LSB Version:	core-11.0.1ubuntu1-noarch:security-11.0.1ubuntu1-noarch
Distributor ID:	Ubuntu
Description:	Ubuntu 19.10
Release:	19.10
Codename:	eoan
//初次使用
//默认的帐密 ubuntu:ubuntu
//可以使用的桌面(可选)
$ sudo apt-get install xubuntu-desktop  # or
$ sudo apt-get install lubuntu-desktop  # or
$ sudo apt-get install kubuntu-desktop  # etc
//使用tasksel(可选) 参考 https://help.ubuntu.com/community/Tasksel
$ sudo apt-get install tasksel
//[相关的wiki百科](https://wiki.ubuntu.com/ARM/RaspberryPi?&_ga=2.213055636.1697914948.1577669395-1300144545.1573614546#Packages) 

//更换源(建议先更换源再安装桌面等包)
$ sudo cp -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
==========分割线==========
$ sudo apt-get update -y	//更新包
$ sudo apt-get upgrade -y	//更新系统

//改变默认编辑器 To change later, run 'select-editor'.

//校准时间
$ sudo apt install ntpdate
$ sudo date -R	//更正时区(该命令查看时区)
$ sudo tzselect 	//调整时区(依次选择 4 → 9 → 1 → 1)
$ sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime	//覆盖原时区设置
$ ntpdate time1.aliyun.com

//安装常用的net-tools
$ sudo apt-get install net-tools

//使用xrdp远程桌面控制(rdp)
$ sudo apt-get install xrdp
$ sudo systemctl start xrdp
$ sudo systemctl enable xrdp
$ sudo lsof -i:3389	//监听3389端口

//安装lsb-core显示完整lsb内容
$ sudo apt-get install lsb-core

//启用root
$ sudo passwd 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
//重启系统即可

//变更图形管理器
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200110135259886.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM1NTkwMTk4,size_16,color_FFFFFF,t_70)

//设置开机启动自定义内容
# 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的软链接
# 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	//开机自启
//重启设备验证






發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章