要求
系统为Debian10
步骤
1. 更新现有软件包
升级前先更新当前的软件包核安全补丁到最新版本:
删除未使用的依赖项:
apt --purge autoremove
2. 更新 sources.list 文件
接下来需要添加用于 bullseye 的源,将 /etc/apt/sources.list
中的 buster 替换为 bullseye,buster/updates 替换为 bullseye-security。
或者直接注释原来的内容,添加:
deb http://deb.debian.org/debian bullseye main
deb-src http://deb.debian.org/debian bullseye main
deb http://deb.debian.org/debian-security/ bullseye-security main
deb-src http://deb.debian.org/debian-security/ bullseye-security main
deb http://deb.debian.org/debian bullseye-updates main
deb-src http://deb.debian.org/debian bullseye-updates main
3. 升级到 Debian 11
执行一下命令
apt update && apt full-upgrade
会提示是否升级,选择y
343 upgraded, 53 newly installed, 3 to remove and 0 not upgraded.
Need to get 165 MB of archives.
After this operation, 140 MB of additional disk space will be used.
Do you want to continue? [Y/n]
接下来的keymap默认即可
你可能会看到有关重新启动服务或更新现有配置选项的提示。因为在升级特定库(例如 libpam、libc 和 libssl)时,由于重新启动可能会导致系统服务中断,比如下图中我选择的是yes,重启服务不需要询问,按Enter键继续:
[img]https://vkceyugu.cdn.bspapp.com/VKCEYUGU-df9040b6-66ef-461b-92a5-f74c4e71766f/5b79882e-ea40-49a8-9731-658bf8f1d76a.png[/img]
接下来的一系列包含*** mlocate (Y/I/N/O/D/Z) [default=N] ?
的选项,选y
,n
都可,看个人喜好。
之后会问你是否更新 OpenSSH 配置文件,我选择的是保留当前版本,如果你更改了 ssh 端口或者设置了密钥登录,最好保留。
[img]https://vkceyugu.cdn.bspapp.com/VKCEYUGU-df9040b6-66ef-461b-92a5-f74c4e71766f/5f62c98a-b5c7-4384-8d7d-3574006f7ad5.png[/img]
4. 查看是否更新完成
root@linux:~# cat /etc/debian_version
11.0
如上所示,系统已成功升级到debian11.
重启系统,完成更新
reboot
执行后,等重启完成即可完成更新。