由于工作需要,启用了公司模版库中Kali Linux 2023的VM,但在更新系统时出现了一下问题:
# apt update
Get:1 http://mirrors.aliyun.com/kali kali-rolling InRelease [41.5 kB]
Err:1 http://mirrors.aliyun.com/kali kali-rolling InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ED65462EC8D5E4C5
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
23 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://mirrors.aliyun.com/kali kali-rolling InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ED65462EC8D5E4C5
W: Failed to fetch http://mirrors.aliyun.com/kali/dists/kali-rolling/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ED65462EC8D5E4C5
W: Some index files failed to download. They have been ignored, or old ones used instead.
N: Repository 'Kali Linux' changed its 'non-free component' value from 'non-free' to 'non-free non-free-firmware'
N: More information about this can be found online at: https://www.kali.org/blog/non-free-firmware-transition/
故障分析:当意外丢失了旧仓库签名密钥(ED444FF07D8D0BF6),导致所有使用 2023/2024 版本(包括 2023.x)的系统在执行 apt update 时都会提示:
“缺少密钥 827C8569F2518CC677FECA1AED65462EC8D5E4C5”。
需要启用了新密钥(ED65462EC8D5E4C5),用户必须手动把新的密钥环放到系统里,否则更新会一直失败。
解决方法:
只要输入以下3条命令就可以解决
1.下载Kali官方签名密钥
─#wget archive.kali.org/archive-key.asc
--2025-07-17 09:24:13-- http://archive.kali.org/archive-key.asc
Resolving archive.kali.org (archive.kali.org)... 192.99.45.140, 2607:5300:60:508c::
Connecting to archive.kali.org (archive.kali.org)|192.99.45.140|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1696 (1.7K) [application/octet-stream]
Saving to: 'archive-key.asc'
archive-key.asc 100%[===============================================>] 1.66K --.-KB/s in 0s
2025-07-17 09:24:14 (136 MB/s) - 'archive-key.asc' saved [1696/1696]
下载完成,将密钥添加到系统中
┌──(root㉿test)-[~]
└─# apt-key add archive-key.asc
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
更新系统
┌──(root㉿test)-[~]
└─# apt-get update
Get:1 http://mirrors.aliyun.com/kali kali-rolling InRelease [41.5 kB]
Get:2 http://mirrors.aliyun.com/kali kali-rolling/non-free Sources [122 kB]
Get:3 http://mirrors.aliyun.com/kali kali-rolling/contrib Sources [80.7 kB]
Get:4 http://mirrors.aliyun.com/kali kali-rolling/main Sources [17.3 MB]
Get:5 http://mirrors.aliyun.com/kali kali-rolling/main amd64 Packages [21.0 MB]
Get:6 http://mirrors.aliyun.com/kali kali-rolling/main amd64 Contents (deb) [51.4 MB]
Get:7 http://mirrors.aliyun.com/kali kali-rolling/non-free amd64 Packages [198 kB]
Get:8 http://mirrors.aliyun.com/kali kali-rolling/non-free amd64 Contents (deb) [910 kB]
Get:9 http://mirrors.aliyun.com/kali kali-rolling/contrib amd64 Packages [118 kB]
Get:10 http://mirrors.aliyun.com/kali kali-rolling/contrib amd64 Contents (deb) [327 kB]
Fetched 91.5 MB in 21s (4290 kB/s)
Reading package lists... Done
W: http://mirrors.aliyun.com/kali/dists/kali-rolling/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
N: Repository 'Kali Linux' changed its 'non-free component' value from 'non-free' to 'non-free non-free-firmware'
N: More information about this can be found online at: https://www.kali.org/blog/non-free-firmware-transition/