1 min read - Posted 12 Jan 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
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

Using Besu, the Java Ethereum Client with Linux/MacOS

Toolbelt: Besu included! Original photo by Jesse Orrico Update: Pantheon is now Hyperledger Besu. For more information, see here. This is the Linux/MacOS version of an article on installing Besu, the Java client for Ethereum: Linux Windows Having some powerful tools in your toolbelt is essential for a Java developer, and one of the crucial tools for an Ethereum blockchain developer is the network client. This is the piece of software that communicates data to and from the blockchain. Among other