安装树莓派Ubuntu步骤
- 使用TF卡和Raspberry imager烧录程序
https://www.raspberrypi.org/software/ - ubuntu 树莓派版
下载地址:https://ubuntu.com/download/raspberry-pi
目前用的是Ubuntu Server 20.04.2 LTS。
ubuntu树莓派版本分两个框架,一个是32位的,一个是64位的,32位是armhf架构,64位的是aarch64架构,在安装的时候要注意选择 - 修改网络
烧录完TF卡程序之后,需要先将TF卡中的network-config中的wifi配置修改一下,否则不能上网
原本格式如下:
wifis:
wlan0:
dhcp4: true
optional: true
access-points:
<wifi network name>:
password: "<wifi password>"
修改之后格式如下:
wifis:
wlan0:
dhcp4: true
optional: true
access-points:
"home network":
password: "123456789"
删除掉需要用的行前面的#,如果wifi名称中有空格,需要用” “括起来,否则不要用” “,会导致无法联网!!
有的TF卡会导致无法联网,换一个TF卡就好了,不知道原因是什么
- 修改源
可以选择清华大学的软件源,有树莓派ubuntu版本和树莓派版的,注意选择
下载地址:https://mirror.tuna.tsinghua.edu.cn/help/ubuntu-ports/
以ubuntu 20.04LTS为例,将/etc/apt/sources.list修改如下:
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-proposed main restricted universe multiverse
- 更新源
sudo apt-get update
sudo apt-get upgrade
此过程可能会出现Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/ubuntu/pool/main/g/gcc-5/g++-5_5.4.0-6ubuntu1~16 的问题,
在/etc/resolvconf/resolv.conf.d/base中添加如下语句即可解决
nameserver 202.96.134.133
nameserver 202.96.128.68(电信)
- 然后就可以安装ubuntu桌面
sudo apt install ubuntu-desktop
等待安装完即可