以下签名无效:EXPKEYSIG 1397BC53640DB551

这是一个链接:问题 952287:[用户反馈 - 稳定版] Chrome for Linux 无法安装/更新,因为 GPG 签名密钥已过期
今天,在我所有的机器上运行apt时,使用Google PPA(用于google-chrome)会出现以下错误:
me@mymachine:~$ sudo apt clean && sudo apt update && sudo apt full-upgrade -y && sudo apt autoremove -y && sudo apt autoclean -y && sudo snap refresh 
[sudo] password for me: 
Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic InRelease
Hit:3 http://dl.google.com/linux/chrome/deb stable Release                     
Hit:4 http://archive.ubuntu.com/ubuntu bionic InRelease                        
Get:5 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88,7 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74,6 kB]
Err:7 http://dl.google.com/linux/chrome/deb stable Release.gpg
  The following signatures were invalid: EXPKEYSIG 1397BC53640DB551 Google Inc. (Linux Packages Signing Authority) <linux-packages-keymaster@google.com>
Get:8 http://archive.ubuntu.com/ubuntu bionic-security InRelease [88,7 kB]
Get:9 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [574 kB]
Get:10 http://archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages [488 kB]
Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 DEP-11 Metadata [278 kB]
Get:12 http://archive.ubuntu.com/ubuntu bionic-updates/main DEP-11 48x48 Icons [66,7 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic-updates/main DEP-11 64x64 Icons [123 kB]
Get:14 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [756 kB]
Get:15 http://archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages [745 kB]
Get:16 http://archive.ubuntu.com/ubuntu bionic-updates/universe Translation-en [201 kB]
Get:17 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [209 kB]
Get:18 http://archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 48x48 Icons [191 kB]
Get:19 http://archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 64x64 Icons [360 kB]
Get:20 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2.468 B]
Get:21 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [7.352 B]
Get:22 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages [296 kB]
Get:23 http://archive.ubuntu.com/ubuntu bionic-security/main i386 Packages [216 kB]
Get:24 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 DEP-11 Metadata [204 B]
Get:25 http://archive.ubuntu.com/ubuntu bionic-security/universe i386 Packages [127 kB]
Get:26 http://archive.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [131 kB]
Get:27 http://archive.ubuntu.com/ubuntu bionic-security/universe Translation-en [74,2 kB]
Get:28 http://archive.ubuntu.com/ubuntu bionic-security/universe amd64 DEP-11 Metadata [20,8 kB]
Get:29 http://archive.ubuntu.com/ubuntu bionic-security/universe DEP-11 48x48 Icons [12,2 kB]
Get:30 http://archive.ubuntu.com/ubuntu bionic-security/universe DEP-11 64x64 Icons [50,4 kB]
Get:31 http://archive.ubuntu.com/ubuntu bionic-security/multiverse amd64 DEP-11 Metadata [2.464 B]
Fetched 5.183 kB in 2s (2.131 kB/s)                                  
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://dl.google.com/linux/chrome/deb stable Release: The following signatures were invalid: EXPKEYSIG 1397BC53640DB551 Google Inc. (Linux Packages Signing Authority) <linux-packages-keymaster@google.com>
W: Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/Release.gpg  The following signatures were invalid: EXPKEYSIG 1397BC53640DB551 Google Inc. (Linux Packages Signing Authority) <linux-packages-keymaster@google.com>
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All snaps up to date.


已经尝试再次导入GPG密钥,使用以下命令:
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -

来源:Google Linux软件仓库

编辑:为了更好的可见性,添加了西班牙语错误行:

Las siguientes firmas no fueron válidas: EXPKEYSIG 1397BC53640DB551 Google Inc. (Linux Packages Signing Authority) <linux-packages-keymaster@google.com>

编辑2:并且为了涵盖前三种语言,添加了法语翻译:

Les signatures suivantes ne sont pas valables : EXPKEYSIG 1397BC53640DB551 Google Inc. (Linux Packages Signing Authority) <linux-packages-keymaster@google.com>


12我也刚好遇到了这种情况。 - Fred
这里也有同样的问题,重新获取密钥目前还没有帮助,看起来是谷歌那边出了问题。 - Florian
重新获取钥匙对我很有帮助。 - Bruni
8点赞这个链接 https://support.google.com/chrome/thread/4032170?hl=en 然后等待!我们已经无能为力了。 - Carlos Alberto Silveira de And
1我在帖子的顶部添加了一个错误报告的链接。请随意移动或删除它。 - DK Bose
4我觉得现在已经修好了。 - Leo
现在同样的问题发生在谷歌 Chrome 远程桌面仓库中 - https://support.google.com/chrome/thread/4111585?hl=en - naXa stands with Ukraine
1今天这件事发生在我身上,8天后它仍在继续发生。 - Gregory Smitherman
请参阅https://askubuntu.com/questions/13065/how-do-i-fix-the-gpg-error-no-pubkey#answer-15272。 - jacobq
8个回答

这些检查是为了保护你的安全。在谷歌出现问题时,你不想立即更新软件。等到他们解决问题之后再进行更新。在官方发布新密钥解决方案之前,不要试图通过重新安装密钥来覆盖原有设置。

15等到他们修复可能不是所有人的选择。例如,这对我们来说正在破坏 CI 流水线。如果你知道自己在做什么,你可以冒险并且通过在配置中添加 [trusted=yes] 来暂时禁用此存储库的检查:deb [trusted=yes] http://dl.google.com/linux/chrome/deb/ stable main - jelhan
4这已经不是第一次发生了。我记得在过去的几年里,至少还有两次遇到了同样的问题。我很好奇谷歌到底出了什么问题,为什么他们不能把事情处理好呢。 - Michael Härtl
如果有用的话,可以使用curl -I https://dl.google.com/linux/linux_signing_key.pub命令在Google的服务器上查看签名密钥最后更改的时间。目前,该命令显示密钥文件的更新日期为2017年7月。 - Michael Firth
5@jelhan 这就是为什么 CI 流水线最好使用本地镜像/缓存,而不是直接从上游获取。 - Konrad Rudolph
3@MichaelHärtl 我一直在关注Google,优势主义似乎已经过时了。 - DK Bose
@jelhan 同意,但你应该暂时将其设置为https,并使用trusted=yes(目前来说,假设你没有遭受TLS中间人攻击)。例如:deb [arch=amd64, trusted=yes] https://dl.google.com/linux/chrome/deb/ stable main - link_boy
7trusted=yes 这样做完全违背了数字签名的初衷,基本上会危及整个系统的安全性。你不应该轻易这样做,尤其对于一个“临时解决方案”来说,更不是一个好主意。 - kissgyorgy


问题已经在2019年4月由Google解决(仅适用于Google Chrome。在Ubuntu 18.04.x上进行了测试)。

enter image description here 无需操作。存储库已经被签名。

更新于2019年4月19日:

enter image description here

Google团队已确认针对其他非Chrome Google产品进行了额外的修复。
来源:https://support.google.com/chrome/thread/4032170

3你在哪里报告了这个问题?谷歌在某些其他仓库(如音乐管理器)还没有修复,所以我也想报告一下。 - Paddy Landau

看起来谷歌的签名密钥过期了。耐心等待他们修复(可能需要在修复后重新添加密钥)。

对于那些耐不住等待谷歌更新证书的人,你可以通过以下步骤来解决这个问题:
1. 下载这个文件:https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb (这是 Chrome 的最新版本,你可以自己搜索谷歌 Chrome 来获取它)
关闭Chrome。 打开“软件和来源”,转到“来源”选项卡。 删除(或禁用,如果您希望以后重新启用)Google源(输入密码),然后关闭窗口。 允许“软件和来源”重新加载来源。 进入软件中心,转到“已安装”。 找到Chrome,卸载它。 关闭软件和来源。 打开终端,键入: sudo apt update && sudo apt autoremove -y && sudo apt autoclean && sudo apt full-upgrade -y 关闭终端,转到下载文件夹,双击文件“google-chrome-stable_current_amd64.deb”(这将打开软件中心)。 点击安装。 现在您可以重新打开Chrome。所有标签和保存的密码等都还在那里。

@CarlosAlbertoSilveiradeAnd说:“太好了!对我来说很有效!谢谢。”但他将其作为对我的帖子的编辑,因为他还不知道如何使用这个网站……我添加这条评论是为了让大家知道它对某人起作用了。 - tatsu

看起来,正如@DooMMasteR所说,Google让签名证书过期了他们的Linux软件源,截止日期是4月12日。@yareckon解释说,这个apt安全错误按预期工作,以防止安装糟糕签名的软件。
问题发布后9小时,Google透明地为使用Google Chrome软件源的用户修复了证书。在他们更新证书后,错误停止了,逐步也在其他Google拥有的软件源上(Google Earth,Google Music Manager等)。
无需用户采取任何行动(也不建议采取),只需等待正在使用的存储库完成使用新密钥进行签名。

Google需要更新他们的GPG密钥。但是你可以将deb源标记为可信任,直到Google更新他们的密钥:
1. `cd /var/lib/apt/lists` 2. 使用以下命令删除文件: ``` sudo rm \ dl.google.com_linux_chrome_deb_dists_stable_main_binary-amd64_Packages \ dl.google.com_linux_chrome_deb_dists_stable_Release \ dl.google.com_linux_chrome_deb_dists_stable_Release.gpg ``` 3. 在你的`/etc/apt/sources.list.d/google-chrome.list`文件中添加`trusted=yes`,使其看起来像这样:`deb [arch=amd64, trusted=yes] https://dl.google.com/linux/chrome/deb/ stable main` 4. 运行`apt clean` 5. 运行`apt update`
你可能仍然会收到无效的GPG错误,但现在可以忽略它。
注意:请小心使用,因为在非受信任的网络上,如果deb源链接没有使用https,可能会带来安全问题。

编辑: GPG警告不再出现。谷歌已经更新了他们的密钥。如果你按照上面的解决方案操作,只需删除trusted=yes这部分,然后执行apt clean,最后执行apt update。你将不再看到任何错误 :D


3不要这样做。即使没有其他原因,源代码未加密也是一个问题。如果你这样做了,然后忘记了它,并且连接到了一个不安全的网络,那么它很容易拦截和篡改发布、packages.list等文件,从而在你的计算机上以root权限运行任何它想运行的东西。这不是一个好主意。 - Oli
但我只是相信谷歌的仓库。我们肯定可以相信谷歌,对吧? - dimisjim
2你没有理解我的观点。如果有人能拦截你的网络流量,他们可以假装成谷歌。在http://连接中没有TLS加密。通常情况下,Apt会保护你,因为他们会检查所有的发布和软件包列表是否已签名。如果你正常地拦截并恶意更改了某些内容,你会看到一个签名错误。而你现在是绕过了整个机制。 - Oli
1确实。谢谢解释。 - dimisjim
2同意,但你可以暂时只将它设置为https,并且trusted=yes(假设你不是TLS MiTM)。 例如:deb [arch=amd64, trusted=yes] https://dl.google.com/linux/chrome/deb/ stable main - link_boy
1也确实是这样。所以我猜我的最近编辑,至少应该回到0而不是-2 :P - dimisjim
这个不起作用。没有任何新的事情发生。我仍然只能手动更新。 - contributorpw
谷歌已经解决了这个问题。不需要按照上述步骤进行操作。 - dimisjim

你不需要这样做。你必须等待谷歌更新他们的密钥并进行更新。
重要信息如下:
以下签名无效:EXPKEYSIG 1397BC53640DB551 Google Inc.(Linux软件包签名机构)
这意味着加密签名无效。造成这种情况的原因可能是攻击、配置错误或其他技术问题。强制系统更新将导致运行未经验证的网页浏览器版本,这可能会给您带来许多安全问题。 source