Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "invalid signature when apt-get update" error?

Tags:

linux

apt-get

Whenever I'm trying to sudo apt-get update I'm getting these errors:

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://packages.linuxmint.com rafaela Release: The following signatures were invalid: BADSIG 3EE67F3D0FF405B2 Clement Lefebvre (Linux Mint Package Repository v1) <[email protected]>

W: GPG error: http://extra.linuxmint.com rafaela Release: The following signatures were invalid: BADSIG 3EE67F3D0FF405B2 Clement Lefebvre (Linux Mint Package Repository v1) <[email protected]>
W: Failed to fetch http://packages.linuxmint.com/dists/rafaela/Release  

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/Release  Unable to find expected entry 'restricted/binary-amd64/Packages' in Release file (Wrong sources.list entry or malformed file)

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/main/binary-amd64/Packages  Hash Sum mismatch

W: Some index files failed to download. They have been ignored, or old ones used instead.

So, I did some reading and tried changing mirrors in the sofetware-sources area, and also followed this answer, and ran this command:

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 3EE67F3D0FF405B2

but got this result which didn't help me:

Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.joWxQNcMmd --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --recv-keys --keyserver keyserver.ubuntu.com 3EE67F3D0FF405B2
gpg: requesting key 0FF405B2 from hkp server keyserver.ubuntu.com
gpg: key 0FF405B2: "Clement Lefebvre (Linux Mint Package Repository v1) <[email protected]>" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1

Any idea what else I can try in order to solve it?

p.s It all started when trying to install nodejs and npm.

like image 561
Donoven Rally Avatar asked Nov 21 '22 00:11

Donoven Rally


1 Answers

This worked for me on Linux Mint 17 Qiana:

sudo rm -r /var/lib/apt/lists

sudo mkdir -p /var/lib/apt/lists/partial

sudo apt-get clean

sudo apt-get update

sudo apt-key list | grep expired

Get the key to use from that result:
pub 4096R/BE1DB1F1 2011-03-29 [expired: 2014-03-28]

sudo apt-key adv --recv-keys --keyserver keys.gnupg.net BE1DB1F1

sudo apt-get update


Solution partially from this post.

like image 61
social Avatar answered Dec 04 '22 03:12

social