An error occurred during the signature verification. The following signatures were invalid

  616 views   6 months ago Ubuntu

Sometimes, while updating repository keys, you may get error as I have get the below error for skype package while running sudo apt-get update command.

Err:6 https://repo.skype.com/deb stable InRelease
The following signatures were invalid: EXPKEYSIG 1F3045A5DF7587C3 Skype Linux Client Repository <[email protected]>

And in the last the error...

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: https://repo.skype.com/deb stable InRelease: The following signatures were invalid: EXPKEYSIG 1F3045A5DF7587C3 Skype Linux Client Repository <[email protected]>
W: Failed to fetch https://repo.skype.com/deb/dists/stable/InRelease  The following signatures were invalid: EXPKEYSIG 1F3045A5DF7587C3 Skype Linux Client Repository <[email protected]>
W: Some index files failed to download. They have been ignored, or old ones used instead.

Basically the error occured because the gpg key for the skype repository is expired in my apt-key database. You may got the expired gpg key or not available error for other package as well.

To resolve the error, there are few hacks which can help you to remove the error when you update the repository list. You can fix the error by importing the gpg key from keyserver.ubuntu.com

Run the below command to update the key with new. Note the last key 1F3045A5DF7587C3. Replace the key 1F3045A5DF7587C3 with the one you are getting error.

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1F3045A5DF7587C3
sudo apt-get update

Or instead try this option. refresh the keys with below command.

sudo apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com
sudo apt-get update

Or the third option is to remove the lists from the directory and run sudo apt-get update command.

sudo apt-get clean
sudo rm -r /var/lib/apt/lists/*
sudo apt update

You can try these option one by one and do commant below which option work for you. I hope it work for you.

Author : Harsukh Makwana
Harsukh Makwana

Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]