Wenn ich versuche, Mongodb mithilfe der Anweisungen unter https://docs.mongodb.com/getting-started/shell/tutorial/install-mongodb-on-ubuntu/16.04 zu installieren, erhalte ich beim Installationsschritt das folgende Ergebnis:
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
Ich habe den HTTP-Verkehr mit Wireshark überprüft und festgestellt, dass der einzige Verkehr ein HTTP-GET für die Liste und eine HTTP-304-Antwort war, was darauf hindeutet, dass das Problem in meinen lokalen Konfigurationsdateien liegt. Meine sources.list.d-Datei enthält den folgenden Eintrag:
mongodb-org-3.4.list
Was muss ich tun, um dieses Problem weiterhin zu beheben?
BEARBEITEN: Ich habe versucht, dies auf einer neuen Installation von 16.04 unter VirtualBox erneut zu tun. Ich habe den Schlüssel abgerufen, die Listendatei erstellt und dabei sudo apt updatefolgende Ergebnisse erzielt:
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 <packaging@mongodb.com>" 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:~$
Wie Sie sehen, wurde der Schlüssel für Mongodb 3.4 und nicht für Mongodb 3.2 abgerufen. Dies erklärt den GPG-Fehler bei der Aktualisierung von apt. Weiß jemand, wo man den richtigen Schlüssel bekommt?

