To update the Raspiberry to a new version

根据你的需求,以下是更新树莓派系统到最新版本的命令行操作步骤:

!/bin/bash

更新软件包列表

sudo apt update

升级已安装软件包

sudo apt full-upgrade -y

清理旧包缓存

sudo apt autoremove -y

重启系统应用更新

sudo reboot

raspberry_系统更新
已完成
查看
更新软件源列表:sudo apt update 获取最新软件包信息
升级所有软件包:sudo apt full-upgrade -y 处理依赖关系并升级系统
清理旧包缓存:sudo apt autoremove -y 删除无用包
重启系统:sudo reboot 应用更新
注意:

使用清华源可加速下载:编辑/etc/apt/sources.list替换为清华镜像
升级前备份重要数据
若需升级主版本(如Buster到Bullseye),需手动编辑/etc/apt/sources.list并运行sudo apt dist-upgrade