## 备份数据 要养成在对系统进行操作前备份的习惯,特别对系统执行大的更改。 建议使用tar归档工具进行全盘备份,并且拷贝到其他磁盘留作备用。 ## 升级软件 在进行大版本升级前,先讲当前系统所有软件包升级到最新,升级完成后重启系统。 ``` sudo apt update sudo apt upgrade sudo apt full-upgrade sudo apt autoremove sudo reboot ``` 查看当前版本信息: ``` cat /etc/debian_version uname -mr ``` ## 升级软件源 首先备份原来的APT源,然后用新的Bookworm源替换原来的Bullseye源。 ``` cp -ar /etc/apt/sources.list /home/backup cp -ar /etc/apt/sources.list.d /home/backup ``` 使用清华镜像源替换原来的源。 镜像地址:[debian](https://mirrors.tuna.tsinghua.edu.cn/help/debian/) sources.list将内容替换如下: ``` deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware ``` ## 执行升级 升级所有软件,并重启。 ``` sudo apt update sudo apt full-upgrade sudo reboot ``` 在升级过程中如果出现提示信息,请仔细阅读并选择相应的操作,例如需要重启服务。 ## 检查升级效果 再次查看系统版本信息,对比之前的版本信息。 ``` cat /etc/debian_version uname -mr ``` https://www.cyberciti.biz/faq/update-upgrade-debian-11-to-debian-12-bookworm/ Loading... ## 备份数据 要养成在对系统进行操作前备份的习惯,特别对系统执行大的更改。 建议使用tar归档工具进行全盘备份,并且拷贝到其他磁盘留作备用。 ## 升级软件 在进行大版本升级前,先讲当前系统所有软件包升级到最新,升级完成后重启系统。 ``` sudo apt update sudo apt upgrade sudo apt full-upgrade sudo apt autoremove sudo reboot ``` 查看当前版本信息: ``` cat /etc/debian_version uname -mr ``` ## 升级软件源 首先备份原来的APT源,然后用新的Bookworm源替换原来的Bullseye源。 ``` cp -ar /etc/apt/sources.list /home/backup cp -ar /etc/apt/sources.list.d /home/backup ``` 使用清华镜像源替换原来的源。 镜像地址:[debian](https://mirrors.tuna.tsinghua.edu.cn/help/debian/) sources.list将内容替换如下: ``` deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware ``` ## 执行升级 升级所有软件,并重启。 ``` sudo apt update sudo apt full-upgrade sudo reboot ``` 在升级过程中如果出现提示信息,请仔细阅读并选择相应的操作,例如需要重启服务。 ## 检查升级效果 再次查看系统版本信息,对比之前的版本信息。 ``` cat /etc/debian_version uname -mr ``` https://www.cyberciti.biz/faq/update-upgrade-debian-11-to-debian-12-bookworm/ 最后修改:2024 年 01 月 17 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 如果觉得我的文章对你有用,请随意赞赏