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  # or
$ sudo apt-get install xfce4 && echo xfce4-session > ~/.xsession
$ sudo systemctl set-default graphical.target	//设置默认进入图形界面(需要重启)
$ sudo dpkg-reconfigure gdm3	//要更改默认显示器为gdm3
//可选 如果开机中在cloud部分卡住无法进入图形界面,可以disable进行关闭
$ sudo systemctl disable cloud-config.service cloud-final.service cloud-init-local.service cloud-init.service

//使用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) 

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

$ sudo dpkg-reconfigure dash	//设置默认的shell为bash

//图形编辑网络连接
$ sudo nmtui
//更换源(建议先更换源再安装桌面等包)
$ 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	//更新系统
$ sudo dpkg-reconfigure tzdata	//设置时区
//or
$ 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	//校准时间
//使用xrdp远程桌面控制(rdp)
$ sudo apt-get install xrdp
$ sudo systemctl start xrdp
$ sudo systemctl enable xrdp
$ sudo lsof -i:3389	//监听3389端口
//安装常用的包
//net-tools
$ sudo apt-get install net-tools
//启用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
//重启系统即可
//设置开机启动自定义内容
# 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	//开机自启
//重启设备验证
//汉化界面
$ sudo apt-get -y install language-pack-zh-hans	//安装中文语言包
//or
$ sudo apt-get -y install language-pack-zh-hans language-pack-zh-hans-base
$ sudo apt-get -y install locales xfonts-intl-chinese fonts-wqy-microhei	//安装字体
$ sudo dpkg-reconfigure locales	//执行本地化语言设置
$ sudo reboot	//重启生效
//管理开机启动项
$ sudo systemctl list-unit-files --type=service|grep enabled	//查看开机启动的服务
$ sudo systemctl disable apache2.service	//禁止开机启动示例
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值