10分钟顺利升级 debian 系统 10 -> 11

debian 是小巧、方便使用的服务器系统,用命令行可以很方便升级。这里记录一下过程,是从 10/buster 升到 11/bullseye,其它版本也类似。

本文是根据官方的文档 Upgrades from Debian 10 (buster) 做简单的过程记录。

备份

万一升级失败或升级后服务不能正常运行,减少服务恢复时间,主要备份程序、数据、配置,这部分有点麻烦,参考官方文档。我的程序是绿色的,所以只需备份服务的配置和服务的数据,其它都是可以通过 apt-get install 来获取。

升级

查看当前系统信息

Bash: 查看当前系统信息
1
2
3
4
$ uname -mrs
Linux 4.19.0-8-amd64 x86_64
$ cat /etc/debian_version
10.3

升级已安装的软件包

Bash: update installed packages
1
2
3
4
5
6
7
8
9
10
11
sudo apt update
sudo apt upgrade
sudo apt full-upgrade
sudo apt --purge autoremove

OR

sudo apt-get update
sudo apt-get upgrade
sudo apt-get full-upgrade
sudo apt-get --purge autoremove

修改文件 /etc/apt/sources.listbuster 替换为 bullseye,下面是使用清华的镜像

INI: 源设置
1
2
3
4
5
6
7
8
9
10
11
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free

deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free

参考 https://mirrors.tuna.tsinghua.edu.cn/help/debian/

运行 apt update

最小升级

Bash: upgrade
1
$ apt upgrade --without-new-pkgs

这一部会弹出窗口,提示升级过程中有些服务需要重启,选择 Yes;提示配置相关... 选保留原来配置。

全部升级

Bash: full-upgrade
1
$ apt full-upgrade

重启系统 systemctl reboot

重启后查看

Bash: uname
1
2
3
4
root@debian:~# uname -mrs
Linux 5.10.0-11-amd64 x86_64
root@debian:~# cat /etc/debian_version
11.2

总结

镜像网速很快,整个过程大概需要10分钟,升级后服务都能正常运行。

本文网址: https://pylist.com/topic/229.html 转摘请注明来源

Suggested Topics

ubuntu/debian 下自行编译 OpenWRT 固件

首先声明,自行编译是一个自我折腾的过程,没时间或精力就不要试了,这里介绍个人尝试在ubuntu/debian 下编译OpenWRT固件和应用SDK 的过程。...

在 Ubuntu 或其它 GNU/Linux 系统下安装 Debian

家有老电脑不用就折腾不止,前段时间曾折腾一台老电脑,2007年上市,只支持 i386 系统,不支持U盘启动,在 winxp 系统下装了 Ubuntu,现在突发奇想,要在 Ubuntu 上安装 Debian。...

WNDR4300 固件升级到 OpenWrt 最新版

Netgear WNDR4300 (v1) 是最经典的能刷openwrt及其分支的路由器,属于性价比比较好的一款。经得起折腾,升级、变砖、恢复,能折腾的都试了。确实是实战中一款耐刷的路由战斗机。...

Ubuntu/Debian 查看CPU温度的方法

刚 DIY 一个小主机,因为使用功率很低的CPU,买了一个金钱豹2U散热器,风扇声音很大,就把风扇拆下来,只使用下面的铜块。就得对CPU问寒问暖,时刻了解它的温度。...

20 分钟完成从 Godaddy 转出域名

以前喜欢在 Godaddy 上注册域名,可能当时有很多优惠码,买域名很划算,后来价格涨了,网站操作界面不流畅,每到期一个就转出一个。...

Leave a Comment