树莓派4B重装系统记录

编程知识 更新时间:2023-04-26 18:28:39

树莓派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

到此暂时结束。

更多推荐

树莓派4B重装系统记录

本文发布于:2023-04-20 04:22:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/f1149df06fadc59bff169fd1bdf829a6.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重装系统   树莓派

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 89623文章数
  • 22757阅读数
  • 0评论数