第一步:
ubuntu@ip-10-10-1-196:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
sudo: unable to resolve host ip-10-10-1-196
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.Nxbg2NlmyB --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/ansible-ansible.gpg --keyring /etc/apt/trusted.gpg.d/ondrej-php.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
gpg: requesting key EA312927 from hkp server keyserver.ubuntu.com
gpg: key EA312927: public key "MongoDB 3.2 Release Signing Key <[email protected]>" imported
gpg: key EA312927: "Totally Legit Signing Key <[email protected]>" not changed
gpg: Total number processed: 2
gpg: imported: 1 (RSA: 1)
gpg: unchanged: 1
第二步
ubuntu@ip-10-10-1-196:~$ echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.2.list
tee: /etc/apt/sources.list.d/mongodb-org-3.2.list: Permission denied
deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse
第三步:
ubuntu@ip-10-10-1-196:~$ sudo apt-get update
W: GPG error: https://repo.mongodb.org xenial/mongodb-org/3.6 Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 58712A2291FA4AD5
ubuntu@ip-10-10-1-196:~$
尝试安装
ubuntu@ip-10-10-1-196:~$ sudo apt-get install mongodb-org
sudo: unable to resolve host ip-10-10-1-196
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
mongodb-org : Depends: mongodb-org-shell but it is not going to be installed
Depends: mongodb-org-server but it is not going to be installed
Depends: mongodb-org-mongos but it is not going to be installed
Depends: mongodb-org-tools but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
我卡住了,尝试手动安装,但不行,我有 Ubuntu 16.04 Xenial