admin 管理员组

文章数量: 887021

树莓派4B 安装ubuntu20.04系统

莫名其妙之前的树莓派进不去系统了,只能再来一遍,以此记录自己的菜嘚行为。

1.官网下载树莓派镜像烧录器(链接)


烧录完成
可以在高级设置中提前设置用户名wifi等信息,这样可以忽略后续步骤

2.设置网络

TF卡中找到network-config

version: 2
ethernets:
  eth0:
    dhcp4: true
    optional: true
#wifis:
#  wlan0:
#    dhcp4: true
#    optional: true
#    access-points:
#      myhomewifi:
#        password: "S3kr1t"
#      myworkwifi:
#        password: "correct battery horse staple"
#      workssid:
#        auth:
#          key-management: eap
#          method: peap
#          identity: "me@example"
#          password: "passw0rd"
#          ca-certificate: /etc/my_ca.pem

改为:

version: 2
ethernets:
  eth0:
    dhcp4: true
    optional: true
wifis:
  wlan0:
    dhcp4: true
    optional: true
    access-points:
      W:    #此处更改为自身WIFI名,名字有空格需要加引号""
        password: "12345678"   #此处更改为自身WIFI密码,需要加引号
#      myworkwifi:
#        password: "correct battery horse staple"
#      workssid:
#        auth:
#          key-management: eap
#          method: peap
#          identity: "me@example"
#          password: "passw0rd"
#          ca-certificate: /etc/my_ca.pem

3.TF卡装入树莓派打开系统

登入路由器端查看树莓派IP,并采用putty、xshell等软件远程登陆系统,第一次路由器没有树莓派的IP显示,把树莓派断电重新连接即可。

下载的系统是20.04,初始登陆账号及密码均为ubuntu,登入成功后会提示更改密码

4.矫正树莓派时间

命令行输入检查树莓派时间

date

与当前时间不同,如下更改:

sudo dpkg-reconfigure tzdata

选择亚洲时区,城市选择上海

5.换源

打开list文件全部注释掉

sudo vim  /etc/apt/sources.list

树莓派是arm架构,不是x86/64,网上大多ubuntu、linux换源的都是x86/64架构的,用在树莓派上安装软件时会报错,比如找不到包等等。

源可换的较多,随意,注意是 ubuntu-ports 即可

# 默认注释了源码仓库,如有需要可自行取消注释
deb https://mirrors.ustc.edu/ubuntu-ports/ focal main restricted universe multiverse
# deb-src https://mirrors.ustc.edu/ubuntu-ports/ focal main main restricted universe multiverse
deb https://mirrors.ustc.edu/ubuntu-ports/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.ustc.edu/ubuntu-ports/ focal-updates main restricted universe multiverse
deb https://mirrors.ustc.edu/ubuntu-ports/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.ustc.edu/ubuntu-ports/ focal-backports main restricted universe multiverse
deb https://mirrors.ustc.edu/ubuntu-ports/ focal-security main restricted universe multiverse
# deb-src https://mirrors.ustc.edu/ubuntu-ports/ focal-security main restricted universe multiverse

更改完成后退出保存并更新:

sudo apt update
sudo apt upgrade

到此暂时结束。

本文标签: 重装系统 树莓派