Jam*_*nan 26 package-management apt skype signature
今天我做了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 <se-um@microsoft.com>
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 <se-um@microsoft.com>
W: Failed to fetch https://repo.skype.com/deb/dists/stable/InRelease The following signatures were invalid: EXPKEYSIG 1F3045A5DF7587C3 Skype Linux Client Repository <se-um@microsoft.com>
W: Some index files failed to download. They have been ignored, or old ones used instead.
Run Code Online (Sandbox Code Playgroud)
为了解决这个问题,我调用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
Run Code Online (Sandbox Code Playgroud)
Lor*_*eel 53
签名密钥的有效期已过期,仅在几天后 Microsoft 生成了新密钥。系统中的密钥替换不是自动的,您需要删除旧密钥并添加新密钥。
有两种方法可以解决这个问题:一种是使用传统apt-key add命令,另一种是手动将新密钥添加到密钥环中。
# 解决方案在 Ubuntu 21.04(包括它)之前有效
您可以删除不再有效的密钥:
sudo apt-key del 1F3045A5DF7587C3
Run Code Online (Sandbox Code Playgroud)
然后重新添加新的有效密钥:
curl https://repo.skype.com/data/SKYPE-GPG-KEY | sudo apt-key add -
Run Code Online (Sandbox Code Playgroud)
运行sudo apt update && sudo apt upgrade你应该看不到任何错误。
# 解决方案在 Ubuntu 21.04 和未来版本中有效
当您尝试apt-key在 Ubuntu 中添加 APT 存储库密钥时,您可能会看到以下消息:
警告:不推荐使用 apt-key。改为在 trust.gpg.d 中管理密钥环文件(请参阅 apt-key(8))。
apt-key 手册页提到:
不推荐使用 apt-key,除了在维护者脚本中使用 apt-key del 从主密钥环中删除现有密钥。
因此,如果您在 21.04 之前使用 Ubuntu 版本,则可以使用apt-key del和apt-key add,但是对于以下版本,您必须手动将密钥添加到密钥环中(在 Ubuntu 21.04 中,两种解决方案都可以完美运行:我测试了它们)。
您可以删除不再有效的密钥:
sudo apt-key del 1F3045A5DF7587C3
Run Code Online (Sandbox Code Playgroud)
下载密钥并将其添加到密钥环:
curl https://repo.skype.com/data/SKYPE-GPG-KEY | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/skype-stable-archive-keyring.gpg
Run Code Online (Sandbox Code Playgroud)
打开skype-stable.list文件...
sudo nano /etc/apt/sources.list.d/skype-stable.list
Run Code Online (Sandbox Code Playgroud)
...并以这种方式修改第一行:
deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/skype-stable-archive-keyring.gpg] https://repo.skype.com/deb stable main
Run Code Online (Sandbox Code Playgroud)
运行sudo apt update && sudo apt upgrade你应该看不到任何错误。