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
Installing Besu binary on Linux

Ever gotten a besu command not found on your terminal? Well, read on Although there are many ways to install software on a Linux machine, an accepted startard p

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