I\'m installing MongoDB on an Ubuntu 14.04 machine, using the instructions at: https://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
So I run:
It seems version 3.2.1 has been released on 11/Jan/2016, and the packages signature is bad since this moment. The packages signature were fine the day before.
refs: https://jira.mongodb.org/browse/SERVER/fixforversion/15908/?selectedTab=com.atlassian.jira.jira-projects-plugin:version-summary-panel
You can either add the --force-yes option, or wait for a few hours that the mongodb team sees and fixes the issue.
There is already a ticket there: https://jira.mongodb.org/browse/SERVER-22144
I also faced this issue when installing MongoDB 4.0 on Ubuntu 16.04. So I did.
sudo rm /etc/apt/sources.list.d/mongodb*.list
- remove any existing file for MongoDB
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E52529D4
- add the key
sudo bash -c 'echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" > /etc/apt/sources.list.d/mongodb-org-4.0.list'
- create a new MongoDB repository list file
Now, Complete the installation with an update of repositories then install MongoDB, enable the mongod
service and start it up, and last, check your MongoDB version:
sudo apt update
sudo apt install mongodb-org
systemctl enable mongod.service
systemctl start mongod.service
mongo --version
I had the same problem, so I did:
root@skarabi:~# apt remove mongodb-org
Then:
root@skarabi:~# sudo rm /etc/apt/sources.list.d/mongodb*.list
After :
root@skarabi:~# apt update
You don't need to reinstall the mongo packages, but just change the key as following:
List the keys to confirm it is expired:
apt-key list | grep "expired:"
Replace the key:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xd68fa50fea312927
The number 0xd68fa50fea312927 is the current valid key id (expires at 2019-10-09), as you can check here.
Actually, the following is very important to solve the problem
$ sudo rm /etc/apt/sources.list.d/mongodb*.list
Sounds like you need to redo the installation steps for MongoDB. First,remove any existing repository file for MongoDB. Do as below.
$ sudo rm /etc/apt/sources.list.d/mongodb*.list
Next, add the key: (without the key, the repository will not load).
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
Now, create a new MongoDB repository list file:
$ echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
After adding the repository details, we need to update the packages list.
$ sudo apt-get update
Now install MongoDB.
sudo apt install mongodb-org
Hope this helps !