随身WIFI折腾记——升级 Debian 13
参考至官方文档
https://www.debian.org/releases/trixie/release-notes/upgrading.zh_CN.html 本文并不严谨,请你尽可能依照官方文档处理
Debian13 已经出来有些时日了,正好在2025年的最后一天给随身WIFI升级到 Debian13 尝鲜。
1.备份
这里不过多赘述。直接使用 miko service tool 进行全盘备份,若后期出问题方便恢复。
2.升级前准备
为了安全考虑,建议全程使用 tmux 或 screen 操作,防止因意外断开连接而导致更新中断。
2.1 一些注意事项
根据官方文档你应该:
只保留官方源,并删除“bookworm-backports”条目
移除过时的软件包、移除非 Debian 软件包
检查并升级手动禁止更新的包
清理配置文件残留
等一系列注意事项......
本人为了方便,有些内容就略过了。
2.2 升级到最新的小版本更新
sudo apt update
sudo apt upgrade
sudo apt full-upgrade2.3 检查并调整 apt 源
修改 /etc/apt/sources.list 配置文件,将原来的 bookworm 源改为为 trixie 源
sudo nano /etc/apt/sources.list# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie-updates main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie-backports main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie-backports main contrib non-free non-free-firmware
# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security trixie-security main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security trixie-security main contrib non-free non-free-firmware同样改一下mobian源
sudo curl -L http://repo.mobian-project.org/mobian.gpg -o /etc/apt/trusted.gpg.d/mobian.gpg
echo "deb http://repo.mobian-project.org/ trixie main" | sudo tee /etc/apt/sources.list.d/mobian.list如果你在 /etc/apt/sources.list.d 有其它源,记得更改。
3.升级
根据官方文档,先进行最小系统升级
sudo apt update
sudo apt upgrade --without-new-pkgs升级期间会提示是否要自动重启服务,输入“yes”并回车。
可能会询问你是否使用新版配置文件或保留旧版,视情况选择。
完成后继续执行
sudo apt full-upgrade4. 一些问题
4.1 配置文件
过程中提示是否使用新配置文件,我选择了用新配置文件,等更新结束之后要再重新配置一遍。
原有的旧文件会重命名加上.dpkg-old的后缀,对比新旧文件再改一次即可
4.2 恢复意外卸载的软件包
这里踩了一个坑,没改mobian源,更新的时候把 mobian-tweaks-common 这个软件包给卸了。
没了这个会导致 USB 网络共享不会自动生效,电脑若想连接就只能用并不怎么好用的 adb shell ......
最后把软件包安装回来即可
sudo apt install mobian-tweaks-commonmobian-tweaks-common的依赖 mobile-tweaks-common 有个sh脚本在 /etc/profile.d/mobile-tweaks-mali.sh,会导致如下报错:
grep: /sys/class/drm/card?/device/of_node/compatible: 没有那个文件或目录直接把脚本内所有内容用#注释,避免报错
4.3 解决zram问题
更新后发现zram-tools失效了,后面发现应该是冲突了,直接卸载掉即可
sudo apt remove zram-tools直接用zram-generator即可
编辑或创建/etc/systemd/zram-generator.conf
sudo nano /etc/systemd/zram-generator.conf[zram0]
zram-size = min(ram)
compression-algorithm = zstd5.尾声
成功升级 Debian13 ,别忘了重启
sudo reboot