树莓派4B安装64位系统出现的一些问题和解决方法

1. 镜像的下载
可以自己去官网下载,我选择的是 Raspberry Pi OS (64-bit) 下的 Raspberry Pi OS with desktop 版本,也可以来我的网盘下载,链接:https://pan.baidu.com/s/1MUCXX6wn2vmuds8se33vmw
提取码:xfjs

2. 镜像的烧录
工具链接:
SDFormatter TF卡的格式化工具(链接:https://pan.baidu.com/s/1XgQlcTQ7xI8Im1EB8dzpbw
提取码:xfjs )
Win32Diskimager 刷机工具(链接:https://pan.baidu.com/s/1otkgb2RjIL8UZyPtT1mAvg
提取码:xfjs )

先使用上面的格式化工具SDFormatter 将TF卡进行格式化为fat格式
然后将TF卡插入读卡器中,使用Win32Diskimager 进行镜像的烧写

3.因为 Debian 11 将不会默认有一个像以往一样的 pi 用户。会和更多的 Linux 发行版一样,第一次使用需要用户自己设定一个用户,如果时使用的官方工具可以在烧录时就一步到位,但我没有使用官方的工具烧录,所以导致镜像烧录完后在登录系统的时候出问题了,我使用以前默认的账户:pi 密码:raspberry 登录不上**,下面是解决方案**

将TF卡插回读卡器,然后找到镜像的根目录,创建userconf.txt文件,然后写入内容为:

pi:$6$//7sRVY4rmHt0A42$MIZIQiQA9JUse6gi.iLr6kDZFF2L7WFSSMdbI3t2mJo9ckdvx.3YD3sUCFirva7ywHXdj5Uqn1hY8.KFwAjfy1

这样在登录时就可以继续使用官方的账户:pi 密码:raspberry
进行登录了

4. 更换apt源为国内源
将 apt 源换成国内源,这里我使用清华大学开源软件镜像站的 Debian 11 bullseye 源。根据清华源的配置提示:

编辑 /etc/apt/sources.list 文件,用以下内容取代:

 # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
 deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
 # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
 deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
 # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
 deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
 # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
 deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
 # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free

编辑 /etc/apt/sources.list.d/raspi.list 文件,删除原文件所有内容,用以下内容取代:

deb https://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ bullseye main

换好源以后执行

sudo apt update
sudo apt upgrade

但是我执行后出现了一些依赖上的错误,解决方式如下

换源时安装依赖出现错误使用
sudo apt-get clean && sudo apt-get update && sudo apt-get upgrade

然后就换源成功了

5. 树莓派重启时需要等待90秒的问题,解决方案如下

打开这个配置文件
sudo vim /etc/systemd/system.conf
在末尾加上
DefaultTimeoutStartSec=10s
DefaultTimeoutStopSec=10s

然后重启就不用等待了

6. 安装外设库wiringPi库时出现了错误,不小心将wiringPi库装成了32位的,然后我的系统是64位的,在编译时出现的一些奇奇怪怪的错误

解决方法:

先卸载32位的wirignPI库,执行下面的命令
sudo apt-get remove wiringpi
sudo apt-get purge wiringpi
hash -r

然后重新获取wiringPi库64位系统版本

git clone https://gitee.com/guation/WiringPi-arm64

如果安装wiriping库时出现错误,缺少依赖,用sudo apt install -f 安装相关依赖

将64位的安装上问题就解决了

7.固定远程ssh登录时的ip地址

sudo vi /etc/rc,local
打开rc.local配置文件
然后在末尾加入
ifconfig wlan0 ip地址

这样每次在同一个局域网内ssh远程连接时都可以用这个ip地址

猜你喜欢

转载自blog.csdn.net/m0_68038554/article/details/131905853