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	//開機自啓
//重啓設備驗證






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