Question

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

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.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Accepted Answer

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.

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 x86_64 x86_64 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?

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel