阿里云全新的debian10.3(buster)镜像,却无法正常执行 sudo apt-get update
。主要报错信息如下:
Err:6 http://mirrors.cloud.aliyuncs.com/debian buster-backports Release
404 Not Found [IP: 100.100.2.148 80]
Err:3 http://mirrors.cloud.aliyuncs.com/debian buster-proposed-updates InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131
Reading package lists... Done
E: The repository 'http://mirrors.cloud.aliyuncs.com/debian buster-backports 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.
W: GPG error: http://mirrors.cloud.aliyuncs.com/debian buster-proposed-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131
E: The repository 'http://mirrors.cloud.aliyuncs.com/debian buster-proposed-updates InRelease' is not signed.
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.
1、通过执行 sudo apt-get update | grep "Failed"
捕捉到更精炼的报错信息,我的执行结果如下:
E: The repository 'http://mirrors.cloud.aliyuncs.com/debian buster-backports Release' does not have a Release file.
W: GPG error: http://mirrors.cloud.aliyuncs.com/debian buster-proposed-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131
E: The repository 'http://mirrors.cloud.aliyuncs.com/debian buster-proposed-updates InRelease' is not signed.
可以发现有两个报错,一个 buster-backports Release 不存在的问题,一个 The following signatures couldn't be verified 的问题
2、首先解决报出的 buster-backports Release 不存在的问题,vi /etc/apt/sources.list
一下,编辑 sources.list 文件。将 buster-backports
涉及的两行注释掉
# deb http://mirrors.cloud.aliyuncs.com/debian/ buster-backports main non-free contrib
# deb-src http://mirrors.cloud.aliyuncs.com/debian/ buster-backports main contrib non-free
之后保存并退出。
3、接下来解决 The following signatures couldn't be verified 的问题,直接安装新版本 debian-archive-keyring 即可
sudo apt-get install debian-archive-keyring
4、最后再次执行 sudo apt-get update
,执行成功!完美!
附:
1、关于buster-backports:
"buster-backports" 是 Debian 10(也被称为 "buster")的 backports 仓库。
Backports 是 Debian 提供的一种机制,允许用户从未来的稳定版本(testing 或 unstable)中获取并安装软件包,这些软件包已经被重新编译,以便在当前的稳定版本中使用。
这种机制的主要目的是允许用户在保持系统稳定性的同时,能够使用到更新的软件版本。例如,如果你正在运行 Debian 10(buster),但你需要一个在 Debian 11(bullseye)中可用的更新版本的软件,你可以从 buster-backports 仓库中获取并安装它。
总的来说,http://mirrors.cloud.aliyuncs.com/debian buster-backports Release 的作用是提供一个可以获取并安装更新版本软件包的源,这些软件包是为当前的 Debian 10 系统重新编译的。
参考文档: