问题
当使用kali更新源后遇到签名失效问题
使用apt-get update会出现如下错误信息
Get:1 https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling InRelease [41.5 kB]
Err:1 https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling InRelease
The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <devel@kali.org>
Hit:2 https://packages.microsoft.com/repos/code stable InRelease
Reading package lists... Done
W: GPG error: https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling InRelease: The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <devel@kali.org>
E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling 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.
解决方式
下载GPG密钥
wget archive.kali.org/archive-key.asc
添加GPG密钥到系统,出现警告不需要理会
apt-key add archive-key.asc
添加密钥后重新执行apt-get update可以正常更新
原理说明
GPG(GNU Privacy Guard)是一种用于加密和签名的工具,在软件包管理中,它被用来验证软件包的来源和完整性。Kali Linux 使用 GPG 密钥对软件包进行签名,当你从软件源下载软件包时,apt
会使用相应的 GPG 密钥来验证软件包的签名。如果签名验证失败,就会出现签名失效的错误。通过下载并添加 Kali Linux 官方的 GPG 密钥,你可以让apt
正确地验证软件包的签名,从而解决签名失效的问题。