找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 34582|回复: 273

树莓派安装后常用设置及优化

 火... [复制链接]
发表于 2021-3-23 13:49 | 显示全部楼层 |阅读模式
本帖最后由 samond 于 2021-3-24 08:09 编辑

为方便以后查阅 现在集中记一下 同时也适用其他设备
树莓派4B 64位(arm64)系统配置系统源
2、64位系统配置(arm64版本)
64位镜像可以直接使用debian的系统源,首先需要编辑/etc/apt/sources.list,使用#号注释原内容,然后在末尾添加Debian的系统源:

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

接着需要配置树莓派官方的软件源,编辑/etc/apt/sources.list.d/raspi.list,同样的,注释原内容,在末尾添加如下内容:

deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui
1
3、32位系统配置(armhf版本)
两者配置方法一致,都是修改上述两个文件(64位系统也可以下述系统源),具体如下:

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

deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib rpi
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib rpi

编辑 /etc/apt/sources.list.d/raspi.list 文件,注释原文件内容,用以下内容取代:

deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui

4、系统更新
系统源和软件源配置完成以后,使用下述两条命令更新:

sudo apt update
sudo apt upgrade -y
原文链接:https://blog.csdn.net/baidu_26678247/article/details/108930421


延长树莓派上SD卡的使用寿命。在/etc/fstab中写入

tmpfs /tmp tmpfs defaults,noatime,nosuid,size=100m 0 0
tmpfs /var/tmp tmpfs defaults,noatime,nosuid,size=30m 0 0
tmpfs /var/log tmpfs defaults,noatime,nosuid,mode=0755,size=100m 0 0
tmpfs /var/run tmpfs defaults,noatime,nosuid,mode=0755,size=2m 0 0
tmpfs /var/spool/mqueue tmpfs defaults,noatime,nosuid,mode=0700,gid=12,size=30m 0 0

原文链接https://shumeipai.nxez.com/2014/ ... ome-in-sd-card.html

关闭树莓派dphys-swapfile
dphys-swapfile stop/uninstall
然后编辑etc/dphys-swapfile 设置为0 重启即可

设置树莓派zram压缩内存
https://github.com/SeryogaBrigada/rpi-zram
运行 ./systemd_install.sh 即可



我的恩山、我的无线 The best wifi forum is right here.
发表于 2021-3-23 14:20 | 显示全部楼层
谢谢楼主分享,论坛有你更精彩
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2021-3-23 14:40 | 显示全部楼层
看看。。。。。。。。。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2021-3-23 15:01 | 显示全部楼层
支持楼主,感谢分享.回复查看!!...
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2021-3-23 17:50 | 显示全部楼层
学习学习
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2021-3-23 21:43 | 显示全部楼层
看看,学习一下
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2021-3-23 21:49 | 显示全部楼层

我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2021-3-23 23:53 来自手机 | 显示全部楼层
s感谢分享,楼主有心了。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2021-3-24 01:07 来自手机 | 显示全部楼层
。。。。。。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2021-3-24 02:13 | 显示全部楼层
Fgjcbbcccvv
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2021-3-24 10:22 | 显示全部楼层
终于看见树莓派有新帖了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2021-3-24 15:24 | 显示全部楼层
好人一生平安
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2021-3-24 19:41 | 显示全部楼层
是做的笔记吗
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2021-3-24 22:06 来自手机 | 显示全部楼层
学习学习!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2021-3-24 22:33 | 显示全部楼层
来看看大神
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-26 05:54

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表