树莓派4b-试玩

148 阅读1分钟

安装系统

树莓派系统默认使用SD卡启动系统,只需通过raspberry pi imager将系统烧录到SD卡中即可,非常方便

raspberry pi imager该软件非常强大,可以在烧录系统的时候,设置开启SSH服务,设置WIFI,这是2个非常关键的服务,对于没有显示器或者连接显示器线的人来说。

烧录完后插上SD卡,直接插上树莓派电源就会自动启动系统,并连接wifi,非常棒!只后就可以进行SSH连接了

连接树莓派并设置系统源

找到树莓派在内网的ip地址,再通过ssh连接上

配置apt为国内清华大学源,网上有很多教程,遇到的问题

  1. The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32 NO_PUBKEY 871920D1991BC93C

执行sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 871920D1991BC93C即可

  1. E: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/focal/main/binary-arm64/Packages 404 Not Found [IP: 101.6.15.130 443] 树莓派4b是ARM架构配置源的时候使用的是x86架构的源地址

改成如下即可:

deb 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 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

解决完上面问题再执行sudo apt-get update

安装Node.js

通过apt-get源的方式安装Node.js

  1. 添加源地址
sudo curl -fsSL https://deb.nodesource.com/setup_18.x | sudo bash -
  1. 执行安装命令
 sudo apt-get install -y nodejs

3.查看node和npm版本

node -v
npm -v