From time to time you will need to update your Mongo pgp key so you can run normal updates. Below is the procedure
When running
sudo apt-get update
You will receive an error such as this when the pgp keys for Mongo are out of date
W: GPG error: . and so on
E: The repository ‘https://repo.mongodb.org/apt/……..’ is not signed
To fix this run the following:
wget -qO – https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add –
You will want to change the 5.0 above to the version listed in the error like this:
wget -qO – https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add –
Press Enter
Mongo will get the new keys
Now you can run
sudo apt-get update
and you will not receive the errors