When I attempt to install mongodb using the instructions on https://docs.mongodb.com/getting-started/shell/tutorial/install-mongodb-on-ubuntu/
on 16.04 I get the following result on the install step:
jonathan@poseidon:~$ sudo apt-get install mongodb-org
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package mongodb-org is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'mongodb-org' has no installation candidate
I checked the HTTP traffic with Wireshark and found that the only traffic was a HTTP GET for the list and a HTTP 304 response which suggests that the problem lies in my local configuration files. My sources.list.d file contains the following entry:
mongodb-org-3.4.list
What do I need to do to continue to troubleshoot this problem?
EDIT:
I tried to do this again on a new install of 16.04 under VirtualBox. I retrieved the key, created the list file, and did sudo apt update
with the following results:
jonathan@Ubuntu-16:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
[sudo] password for jonathan:
Executing: /tmp/tmp.uWYpRUWfjK/gpg.1.sh --keyserver
hkp://keyserver.ubuntu.com:80
--recv
0C49F3730359A14518585931BC711F9BA15703C6
gpg: requesting key A15703C6 from hkp server keyserver.ubuntu.com
gpg: key A15703C6: public key "MongoDB 3.4 Release Signing Key <[email protected]>" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
jonathan@Ubuntu-16:~$ echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse
jonathan@Ubuntu-16:~$ sudo apt update
Ign:1 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 InRelease
Get:2 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release [3 462 B]
Hit:3 http://mx.archive.ubuntu.com/ubuntu xenial InRelease
Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB]
Get:5 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release.gpg [801 B]
Get:6 http://mx.archive.ubuntu.com/ubuntu xenial-updates InRelease [95.7 kB]
Ign:5 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release.gpg
Get:7 http://mx.archive.ubuntu.com/ubuntu xenial-backports InRelease [92.2 kB]
Reading package lists... Done
W: GPG error: http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D68FA50FEA312927
E: The repository 'http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
jonathan@Ubuntu-16:~$
As you can see, the key retrieved was for Mongodb 3.4, not Mongodb 3.2 and this explains the GPG failure in apt update. Any one know where to get the correct key?