按照惯常的Debian升级方式,就是apt update&&apt upgrade
更新软件包,然后替换/etc/apt/sources.list
里面的版本号,例如buster
→bullseye
之后,再执行一次apt update&&apt upgrade
但是在升级Debian11时此方法会报错:
E: The repository 'http://security.debian.org/debian-security bullseye/updates Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
是因为Security库的格式发生了变化。以下为正确格式,替换即可。
deb http://security.debian.org/debian-security bullseye-security main contrib non-free