Question

why is apt-get update saying can't execute apt-key?

Posted October 4, 2016 12.8k views
System Tools Ubuntu 16.04

Since upgrading to Ubuntu 16.04.01, every time I try apt-get update, I see:

W: GPG error: http://security.ubuntu.com/ubuntu xenial-security InRelease: Could not execute ‘apt-key’ to verify signature (is gnupg installed?)

With chattr +a /tmp and apt-get -o “Debug::Acquire::gpgv=true” update, I tried rerunning apt-key by hand with the same arguments, and it runs fine.

I created a new droplet with 14.04 and upgraded it to 16.04 and it works fine.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

4 answers

The real answer in my case was that my kernel was way out of date (although for the life of me I can’t understand why that would make any difference). It was failing in execve (returning EPERM). I hadn’t noticed that even though apt-get would install a new kernel, the droplet would never actually use the new kernel.

I encountered this problem today when I tried to update my company’s servers and it prevented me from updating the packages and the kernel as well.

The solution was simply to reboot the server and everything is working now as expected.

It appears that this is a known issue that affects some users. One comment near the bottom specifically talks about upgrading from 14.04 to 16.04 and seeing this problem. In that case it was resolved by a reboot.

Curiously I am getting the error right now for a droplet that is reporting it is on 16.04.2 LTS


uname -a

Linux 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x8664 x8664 x86_64 GNU/Linux


lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial


apt-get update

Hit:1 http://us.archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Err:1 http://us.archive.ubuntu.com/ubuntu xenial InRelease
Could not execute ‘apt-key’ to verify signature (is gnupg installed?)
Err:2 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease
Could not execute 'apt-key’ to verify signature (is gnupg installed?)
Get:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Err:3 http://security.ubuntu.com/ubuntu xenial-security InRelease
Could not execute 'apt-key’ to verify signature (is gnupg installed?)
Fetched 204 kB in 0s (404 kB/s)
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://us.archive.ubuntu.com/ubuntu xenial 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://us.archive.ubuntu.com/ubuntu xenial-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://security.ubuntu.com/ubuntu xenial-security InRelease: Could not execute 'apt-key’ to verify signature (is gnupg installed?)
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial/InRelease Could not execute 'apt-key’ to verify signature (is gnupg installed?)
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease Could not execute 'apt-key’ to verify signature (is gnupg installed?)
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease Could not execute 'apt-key’ to verify signature (is gnupg installed?)
W: Some index files failed to download. They have been ignored, or old ones used instead.


What’s going wrong here?

Submit an Answer