运行 apt-get update 时签名无效

运行 apt-get update 时签名无效

我正在尝试运行更新,我收到很多“Hit”和“Ign”,但最终我收到这些错误,有人知道它们的含义以及如何修复它们吗?

W: GPG error: http://speglar.simnet.is olivia Release: The following signatures were invalid: BADSIG 3EE67F3D0FF405B2 Clement Lefebvre (Linux Mint Package Repository v1) <[email protected]>
W: GPG error: http://speglar.simnet.is raring Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <[email protected]>
W: GPG error: http://archive.canonical.com raring Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <[email protected]>
W: GPG error: http://ppa.launchpad.net raring Release: The following signatures were invalid: BADSIG 5A9A06AEF9CB8DB0 Launchpad PPA for Ubuntu Wine Team

答案1

正如 Gilles 所解释的,大多数 Linux 存储库都是用GPG 加密密钥apt然后使用这些密钥来确保存储库的真实性。为了安全地使用存储库,您需要将其密钥添加到apt受信任的列表中。

每个必要的密钥都需要从密钥服务器这是用这个命令完成的(我正在使用,keyserver.ubuntu.com但你可以使用其他命令):

apt-key adv --recv-keys --keyserver keyserver.ubuntu.com KEY_NAME

man apt-key

   adv
       Pass advanced options to gpg. With adv --recv-key you can download
       the public key.

在您的情况下,apt正在抱怨 key 3EE67F3D0FF405B240976EAF437D05B5和,您可以通过运行40976EAF437D05B55A9A06AEF9CB8DB0获取所有三个:

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 3EE67F3D0FF405B2 40976EAF437D05B5 40976EAF437D05B5 5A9A06AEF9CB8DB0

如果一切顺利,您应该看到多行输出,包括:

gpg: Total number processed: 4
gpg:               imported: 4  (RSA: 1)
gpg:              unchanged: 0
gpg:         new signatures: 4

答案2

另一种可能性是,如果最近发现您的 apt-get/aptitude 处于异常状态,则其内部列表已损坏且与真实密钥不兼容。清理缓存并重新启动可以帮助:

   sudo rm -r /var/lib/apt/lists
   sudo mkdir -p /var/lib/apt/lists/partial
   sudo aptitude update

(操作:http://ubuntuforums.org/showthread.php?t=802156&p=9697234#post9697234

答案3

就我而言,这是一个时间同步问题。为了后代分享解决方案(原解

sudo nano /etc/resolv.conf

# add the following servers
nameserver 8.8.8.8
nameserver 8.8.4.4

#Run this
sudo hwclock -s

相关内容