1 min read - Posted 10 Feb 20

Solving the "The following signatures were invalid: KEYEXPIRED" apt-get update linux error

The Error

My travis CI pipeline builds randomly starting failing recently, with the following exception:

Reading package lists...
W: GPG error: precise/mongodb-org/3.4 Release: The following signatures were invalid: KEYEXPIRED 1578250443
E: The repository ' precise/mongodb-org/3.4 Release' is not signed.
The command "sudo apt update" failed and exited with 100 during 

The mongoDB certificates had expired!

The Solution

Luckily, I stumbled upon a simple, one-line command that updates all the expired keys from the ubuntu keyserver:

sudo apt-key list | \
 grep "expired: " | \
 sed -ne 's|pub .*/\([^ ]*\) .*|\1|gp' | \
 xargs -n1 sudo apt-key adv --keyserver hkp:// --recv-keys

This command first lists all the keys in the sytem, then narrows this list down to only expired keys. The expired keys are then extracted and updated.

Thanks to Peter and dlopatin for this solution.

Created with Sketch.Content is"CC-BY-SA 4.0" licensed
Article On-chain
Article Author

Craig Williams

Software Developer @ Kauri / ConsenSys




Related Articles
Minimum Viable Plasma - The Kyokan Implementation

The issues around scaling Ethereum to high-throughput production use cases are well known. There are many solutions to this problem in progress, from state channels to side chains, but an additional complexity is safely transferring transactions between the Ethereum mainchain and these other locations. Plasma is a framework proposed by Joseph Poon and Vitalik Buterin to address this, and a handful of projects rapidly emerged to try and implement this proposal. Following this was a post from Vita

Chris Ward

14 Jan 19

Ethereum on ARM. Turn your ARM device into a full Ethereum node just by flashing a MicroSD card

Ethereum on ARM is a project that provides custom Linux images for ARM devices that run Geth, Parity and Nethermind Ethereum clients as a boot service and autom