今天我做了sudo apt upgrade
,然后,作为一个双重检查,做了sudo apt update
。后者终止于:
Hit:5 http://dl.google.com/linux/chrome/deb stable InRelease
Get:6 https://repo.skype.com/deb stable InRelease [4,502 B]
Err:6 https://repo.skype.com/deb stable InRelease
The following signatures were invalid: EXPKEYSIG 1F3045A5DF7587C3 Skype Linux Client Repository <[email protected]>
Fetched 4,502 B in 5s (894 B/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: https://repo.skype.com/deb stable InRelease: The following signatures were invalid: EXPKEYSIG 1F3045A5DF7587C3 Skype Linux Client Repository <[email protected]>
W: Failed to fetch https://repo.skype.com/deb/dists/stable/InRelease The following signatures were invalid: EXPKEYSIG 1F3045A5DF7587C3 Skype Linux Client Repository <[email protected]>
W: Some index files failed to download. They have been ignored, or old ones used instead.
为了解决这个问题,我打了电话sudo apt remove skypeforlinux
,然后又做了一个sudo apt update
. 更新再次以关于无效签名的消息终止。
如何清除此无效签名问题?
$ uname -mrs
Linux 5.4.0-77-generic x86_64
$ lsb_release -d
Description: Ubuntu 20.04.2 LTS
签名密钥的有效期已经过期,几天后微软才生成了一个新密钥。您系统中的密钥替换不是自动的,您需要删除旧密钥并添加新密钥。
有两种解决问题的方法:一种是使用传统
apt-key add
命令,另一种是手动将新密钥添加到密钥环中。# 解决方案在 Ubuntu 21.04 之前有效(包括它)
您可以删除不再有效的密钥:
然后重新添加新的有效密钥:
运行
sudo apt update && sudo apt upgrade
你应该看不到错误。# 解决方案在 Ubuntu 21.04 和未来版本中有效
当您尝试
apt-key
在 Ubuntu 中使用添加 APT 存储库密钥时,您可能会看到以下消息:apt-key 手册页提到:
因此,如果您使用 Ubuntu 21.04 之前的版本,则可以使用
apt-key del
andapt-key add
,但对于以下版本,您必须手动在密钥环中添加密钥(在 Ubuntu 21.04 中,这两种解决方案都可以正常工作:我对它们都进行了测试)。您可以删除不再有效的密钥:
下载密钥并将其添加到密钥环:
打开
skype-stable.list
文件......并以这种方式修改第一行:
运行
sudo apt update && sudo apt upgrade
你应该看不到错误。