Ubuntu: “GPG error: Release: The following signatures were invalid: BADSIG”



Question:

I ran this command in the Terminal:

sudo apt-get update  

Updating ends with the following error report:

W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://extras.ubuntu.com precise Release: The following signatures were invalid: BADSIG 16126D3A3E5C1192 Ubuntu Extras Archive Automatic Signing Key <ftpmaster@ubuntu.com>    W: GPG error: http://ppa.launchpad.net precise Release: The following signatures were invalid: BADSIG 4C1CBC1B69B0E2F4 Launchpad PPA for Jonathan French  W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/precise/Release    

What does this mean and why is it happening?


Solution:1

Try this:

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  


Solution:2

This message is displaying because the gpg key for that repository is missing in your apt-key database.

To import the key, open a terminal and enter these commands

gpg --keyserver keyserver.ubuntu.com --recv-keys 16126D3A3E5C1192   

pgp keys are mostly distributed in several keystore. Ubuntu related keys are usually found in keyserver.ubuntu.com. But if that fails you can use alternatives. Like -

gpg --keyserver hkp://subkeys.pgp.net --recv-keys 16126D3A3E5C1192  

You must replace the alphanumeric part, with the specific key. Make sure the key is one you trust. Any repository with this key, would be able to install any package without warning.

You would see the following output if the above is successful

gpg: Total number processed: 1  gpg:               imported: 1  

Then run this command:

gpg --export --armor 16126D3A3E5C1192 | sudo apt-key add -   

Note the - sign after add.

Then sudo apt-get update, you will have no such messages after this.


Solution:3

I found that just doing sudo rm -rf /var/lib/apt/lists && sudo mkdir /var/lib/apt/lists worked for me.


Solution:4

The following commands solved the problem for me:

sudo -i  apt-get clean  cd /var/lib/apt  mv lists lists.old  mkdir -p lists/partial  apt-get clean  apt-get update  


Solution:5

You can try my script to automatically receive all GPG keys for PPAs you use: smartupdate.sh.

It will launch apt-get update, then find all GPG errors and receive keys for found GPG signatures. In your case, it will just launch

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4C1CBC1B69B0E2F4  

but when you add a few unsigned PPAs, it becomes boring to add GPG keys manually. :)


Solution:6

I got a similar error. But instead of BADSIG I got KEYEXPIRED for the PostgreSQL repo:

W: A error occurred during the signature verification.    The repository is not updated and the previous index files will be used.    GPG error: http://apt.postgresql.org precise-pgdg Release:    The following signatures were invalid: KEYEXPIRED 1381654177  

The solution is perfectly described here but this is what I did to solve it:

$ sudo apt-key list | grep -B1 PostgreSQL  $ sudo apt-key del ACCC4CF8  $ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -  

And now $ sudo apt-get update will work perfectly!


Solution:7

This tip (from actionparsnip) worked for me:

Try:

sudo fuser -vvv /var/lib/dpkg/lock  sudo rm /var/lib/apt/lists/lock  sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup  sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status  sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available  sudo rm -rf /var/lib/dpkg/updates/*  sudo rm -rf /var/lib/apt/lists  sudo rm /var/cache/apt/*.bin  sudo mkdir /var/lib/apt/lists  sudo mkdir /var/lib/apt/lists/partial  LANG=C;sudo apt-get clean  LANG=C;sudo apt-get autoclean  LANG=C;sudo apt-get --purge autoremove  LANG=C;sudo apt-get update -o APT::Cache-Limit=25165824  sudo dpkg --clear-avail  sudo dpkg --configure -a  LANG=C;sudo apt-get -f install  LANG=C;sudo apt-get --fix-missing install  LANG=C;sudo apt-get update -o APT::Cache-Limit=25165824 && sudo apt-get dist-upgrade  

Found in:
https://answers.launchpad.net/ubuntu/+source/update-manager/+question/194077


Solution:8

You can use launchpad-getkeys to fix this. Open a terminal and enter:

sudo apt-get install launchpad-getkeys  sudo launchpad-getkeys  

Then

sudo apt-get update  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »