18

When I run apt-get update I get

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.

I have no idea how this happened or how to fix it. I have gnupg, gnupg-agent, gnupg-pkcs11-scd, gnupg2, gnupg-curl, gnupg-pkcs11-scd-dbg installed.

2
  • I'm not trying to be rude but are you typing "sudo" in front of that? So "sudo apt-get update" would be the full command.
    – FiZi
    Commented Mar 31, 2016 at 0:55
  • Focus on Errors (E) then on Warnings (W). It said " The repository 'http.kali.org/kali kali-rolling Release' is no longer signed". So find if it is still supported and in case update the its signature. If you still have kali 1 it is suggested to upgrade, read here for example. @FiZi I think it is not related with sudo, apt-get should warn in that case.
    – Hastur
    Commented Mar 31, 2016 at 8:28

7 Answers 7

21

Clear APT cache and regenerate it:

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
4
  • I tried this, but it didn't work for me. Still receiving similar messages. Get:1...14 Get:15 archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [74.9 kB] Fetched 14.9 MB in 4s (3,172 kB/s) Reading package lists... Done W: GPG error: security.ubuntu.com/ubuntu xenial-security InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?) W: The repository 'security.ubuntu.com/ubuntu xenial-security InRelease' is not signed. Commented Jul 10, 2016 at 1:44
  • N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. Commented Jul 10, 2016 at 1:46
  • @AnasGamal maybe edit your answer to say why it will work, e.g. like you commented that it will clear the cache
    – TungstenX
    Commented Nov 11, 2016 at 9:40
  • I tried this but got errors when trying to do apt-get clean could you please explain what each step in this solution is doing?
    – serup
    Commented Feb 22, 2017 at 7:36
19

Solved by doing a docker system prune(?!). Is it the image that was in a bad state? Was it a problem caused by not having enough disk space?

Maybe something to consider if you're having the problem inside a docker.

3
  • 1
    This was the solution for me! Thanks!
    – Ilion
    Commented Jul 6, 2020 at 23:06
  • This has WTF written all over it, but it helped! Thanks ...
    – barfuin
    Commented Oct 24, 2020 at 15:13
  • Helped me as well! I'd love to know what the true cause behind this was...
    – kgutwin
    Commented Feb 9, 2021 at 16:32
2

Maybe there is an invalid link or file in directory /etc/apt/trusted.gpg.d/

Check that the directory contains valid files and links, in example:

# 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

Therefore, look for the package that must contain the file

# 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

and take some of the following actions:

reinstall it

# aptitude reinstall live-net-archive-keyring

or reinstall all the installed keyrings

# 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 

or remove the invalid link or file

# rm /etc/apt/trusted.gpg.d/live-net-archive-keyring.gpg 
2
  • Welcome to Super User. You can freely edit your own posts but for your protection, this must be done under the original user account. It looks like you have created a second account, which will also interfere with your ability to comment within your thread. See Merge my accounts to get your accounts merged.
    – fixer1234
    Commented Jul 8, 2016 at 15:55
  • Also check all .gpg files in /etc/apt/trusted.gpg.d/ directory have permission to be read by everyone: sudo chmod +r /etc/apt/trusted.gpg.d/.gpg
    – Maxime
    Commented Sep 19, 2016 at 4:56
2

I got this error after converting a ubuntu 18 classic image with qemu-img to VMware player 15 and forgot to expand the disk size. Some of the update and upgrade stuff went through, but then it stuck on this signature thing.

I wanted to add this to this thread. Could be a "simple" disk space issue. I reinstalled everything again and expanded the disk before first boot and it's running fine now.

1
  • for me, it was a full disk as well. quite a misleading error by GPG, though… Commented Sep 6, 2023 at 9:09
0

Try chown root:root /tmp chmod 1777 /tmp

0

All my keys were correct, but okwap's solution cued me to look at the /tmp directory.

I had thousands of sub-directories in there, made by a service process that was having issues starting. I even had problems deleting all the dirs because there were so many (had to pipe ls to xargs to avoid "too many arguments" errors).

As soon as my /tmp was cleaned up, apt-get update worked fine again. So I suspect there's some code in apt-get update related to signature checking which uses /tmp and fails when there are a silly number of items in there.

0

I have also seen apt-get verification failures when the system time is wrong.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .