树莓派入门(十) 树莓派系统升级

1、背景:生产使用的树莓派备份卡,长时间没有更新,然后新买的树莓派板子的bootloder 是新的会导致树莓派开机起来无法识别的板子,所以需要将树莓派的备份卡系统重新升级下。

1、更换国内源 清华或者阿里

sudo nano /etc/apt/sources.list

使用#号注释其他源,然后输入新的源

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

2、执行

 sudo apt update

获取:1 http://mirrors.ustc.edu.cn/raspbian/raspbian buster InRelease [15.0 kB]
获取:2 http://mirrors.ustc.edu.cn/archive.raspberrypi.org/debian buster InRelease [32.6 kB]
E: 仓库’http://mirrors.ustc.edu.cn/raspbian/raspbian buster InRelease’将其’Suite’值从’stable’修改到了’oldstable’
N: 为了让这个仓库能够应用,这必须在更新之前显式接受。更多细节请参阅 apt-secure(8) 手册。
您是否愿意接受这些更改,并且继续从此仓库更新? [y/N]
运行完成后继续

 sudo apt-get update

如果出现
E: 仓库’http://mirrors.ustc.edu.cn/raspbian/raspbian buster InRelease’将其’Suite’值从’stable’修改到了’oldstable’
N: 为了让这个仓库能够应用,这必须在更新之前显式接受。更多细节请参阅 apt-secure(8) 手册。
E: 仓库’http://mirrors.ustc.edu.cn/archive.raspberrypi.org/debian buster InRelease’将其’Suite’值从’testing’修改到了’oldstable’
N: 为了让这个仓库能够应用,这必须在更新之前显式接受。更多细节请参阅 apt-secure(8) 手册。
则是指令sudo apt update
运行运行不成功导致

3、sudo apt-get upgrade -y
4、sudo apt-get dist-upgrade -y
5、更新更新linux内核

sudo rpi-update

最后一个是一般系统会保留上一个内核和上一个系统的部分信息。一般不用管。如果空间不够了,可以运行这几个命令试试:

sudo apt autoremove

清理下载文件的存档 && 只清理过时的包

sudo apt-get clean && sudo apt-get autoclean

你可能感兴趣的:(树莓派入门,linux,debian,bash)