apt-get更新不起作用:签名/验证错误


11

当我跑步时apt-get update我得到

Ign:1 http://dl.google.com/linux/musicmanager/deb stable InRelease
Ign:2 http://archive-4.kali.org/kali kali-rolling InRelease                
Hit:3 http://archive-4.kali.org/kali-security sana/updates InRelease
0% [3 InRelease gpgv 11.9 kB] [Waiting for headers] [Waiting for headers]Couldn't create tempfiles for splitting up /var/lib/apt/lists/security.kali.org_kali-seErr:3 http://archive-4.kali.org/kali-security sana/updates InRelease     
  Could not execute 'apt-key' to verify signature (is gnupg installed?)
Hit:4 http://archive-4.kali.org/kali sana InRelease                      
0% [4 InRelease gpgv 20.3 kB] [Waiting for headers]Couldn't create tempfiles forErr:4 http://archive-4.kali.org/kali sana InRelease_dists_sana_InRelease
  Could not execute 'apt-key' to verify signature (is gnupg installed?)
Get:5 http://archive-4.kali.org/kali kali-rolling Release [23.7 kB]
Get:6 http://archive-4.kali.org/kali kali-rolling Release.gpg [819 B]          
0% [6 Release.gpg gpgv 23.7 kB]                                    3,846 B/s 0smktemp: failed to create directory via template '/tmp/tmp.XXXXXXXXXX': Permission denied
Err:6 http://archive-4.kali.org/kali kali-rolling Release.gpg                  
  At least one invalid signature was encountered.
Hit:7 http://dl.google.com/linux/musicmanager/deb stable Release               
80% [Release.gpg gpgv 1,345 B]mktemp: failed to create directory via template '/tmp/tmp.XXXXXXXXXX': Permission denied
Err:8 http://dl.google.com/linux/musicmanager/deb stable Release.gpg
  At least one invalid signature was encountered.
Reading package lists... Done 
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive-4.kali.org/kali-security sana/updates InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive-4.kali.org/kali sana InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: GPG error: http://archive-4.kali.org/kali kali-rolling Release: At least one invalid signature was encountered.
E: The repository 'http://http.kali.org/kali kali-rolling Release' is no longer 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.
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/musicmanager/deb stable Release: At least one invalid signature was encountered.

我不知道这是怎么发生的或如何解决的。我安装了gnupg,gnupg代理,gnupg-pkcs11-scd,gnupg2,gnupg-curl,gnupg-pkcs11-scd-dbg。


我不是在尝试粗鲁,但是您在前面输入“ sudo”吗?因此,“ sudo apt-get update”将是完整命令。
斐济

关注错误(E),然后关注警告(W)。它说:“存储库' http.kali.org/kali kali-rolling Release'不再签名”。因此,找到它是否仍然受支持,以防万一更新其签名。如果您仍然有kali 1,建议升级,例如,在这里阅读。@FiZi我认为它与sudo无关,在这种情况下应该警告apt-get。
哈斯图尔

Answers:


16

清除APT缓存并重新生成它:

sudo apt-get clean
sudo mv /var/lib/apt/lists /tmp
sudo mkdir -p /var/lib/apt/lists/partial
sudo apt-get clean
sudo apt-get update

我试过了,但是对我没用。仍收到类似消息。Get:1 ... 14 Get:15 archive.ubuntu.com/ubuntu xenial-updates / universe Translation-zh-cn [74.9 kB]以4s(3,172 kB / s)的速度获取了14.9 MB的读取包列表...完成W:GPG错误:security.ubuntu.com/ubuntu xenial-security InRelease:无法执行“ apt-key”以验证签名(是否安装了gnupg?)W:存储库“ security.ubuntu.com/ubuntu xenial-Security InRelease”不是签。
戴夫·麦基

N:此类存储库中的数据无法通过身份验证,因此可能存在使用危险。N:有关存储库创建和用户配置的详细信息,请参见apt-secure(8)联机帮助页。
戴夫·麦基

@AnasGamal可能会编辑您的答案以说明它为什么会起作用,例如您评论说它将清除缓存
TungstenX

我尝试了此方法,但是在尝试进行apt-get clean时出现错误,您能否解释一下此解决方案的每个步骤在做什么?
serup

1

目录中可能存在无效的链接或文件 /etc/apt/trusted.gpg.d/

检查目录是否包含有效的文件和链接,例如:

# ls -L /etc/apt/trusted.gpg.d/* > /dev/null
ls: cannot access '/etc/apt/trusted.gpg.d/live-net-archive-keyring.gpg': No such file or directory

因此,寻找必须包含该文件的软件包

# dpkg -S /etc/apt/trusted.gpg.d/live-net-archive-keyring.gpg
live-net-archive-keyring: /etc/apt/trusted.gpg.d/live-net-archive-keyring.gpg

并采取以下一些措施:

重新安装

# aptitude reinstall live-net-archive-keyring

或重新安装所有已安装的钥匙圈

# aptitude reinstall $(dpkg -l '*keyring' | awk '$1 == "ii" {print $2}')
The following packages will be REINSTALLED:
debian-archive-keyring gnome-keyring live-net-archive-keyring siduction-archive-keyring 

或删除无效的链接或文件

# rm /etc/apt/trusted.gpg.d/live-net-archive-keyring.gpg 

欢迎来到超级用户。您可以自由编辑自己的帖子,但是为了保护自己,此操作必须在原始用户帐户下完成。您似乎已经创建了第二个帐户,这也会干扰您在线程中发表评论的能力。请参阅合并我的帐户以合并您的帐户。
fixer1234 '16

还要检查/etc/apt/trusted.gpg.d/目录中的所有.gpg文件是否具有所有人可读的权限:sudo chmod + r /etc/apt/trusted.gpg.d/ .gpg
Maxime


0

我所有的密钥都是正确的,但是okwap的解决方案提示我查看/ tmp目录。

我那里有成千上万个子目录,这些子目录是由一个开始出现问题的服务过程组成的。我什至在删除所有目录时遇到问题,因为目录太多(必须将ls传递给xargs以避免“参数过多”错误)。

清理完/ tmp后,apt-get update再次正常运行。因此,我怀疑在apt-get更新中有一些代码与签名检查有关,该代码使用/ tmp并在其中存在大量项目时失败。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.