My system is Ubuntu12.10 first add key: apt-keyadv--keyserverkeyserver.ubuntu.com -- recv7F0CEB10 once it comes up with an error: Executing: gpg -- ignore-time-conflict -- no-options -- no-default-keyring -- secret-keyring/tmp. P
My system is Ubuntu 12.10
First, add the key:
Apt-key adv -- keyserver keyserver.ubuntu.com -- recv 7F0CEB10
An error occurs as soon as it comes up:
Executing: gpg -- ignore-time-conflict -- no-options -- no-default-keyring -- secret-keyring/tmp. PJ6JkuPTDR -- trustdb-name/etc/apt // trustdb. gpg -- keyring/etc/apt/trusted. gpg -- primary-keyring/etc/apt/trusted. gpg -- keyserver keyserver.ubuntu.com -- recv 7F0CEB10
Gpg: requesting key 7F0CEB10 from hkp server keyserver.ubuntu.com
Gpg: keyserver timed out
Gpg: keyserver receive failed: keyserver error
The keyserver.ubuntu.com server uses port 11371, which is restricted in the company network.
So we need to use SSH tunnel:
Ssh-fNL 11371: keyserver.ubuntu.com: 11371 root @ non-blocked-server-p 443 sudo apt-key adv -- keyserver 127.0.0.1 -- recv 7F0CEB10
Assume that there is an Ubuntu server outside the company with a public IP address. The non-blocked-server is used to indicate its IP address, and the SSH service is installed. Set the port to HTTPS port: 443. because the company firewall allows access to port 443 outside.
After the preceding command is run, a tunnel is established and the Local Machine listens to port 11371.
Then add the key:
Apt-key adv -- keyserver 127.0.0.1 -- recv 7F0CEB10
Note that keyserver.ubuntu.com is replaced with 127.0.0.1.
Now added successfully:
-- Primary-keyring/etc/apt/trusted. gpg -- keyserver 127.0.0.1 -- recv 7F0CEB10
Gpg: requesting key 7F0CEB10 from hkp server 127.0.0.1
Gpg: key 7F0CEB10: public key "Richard Kreuter "Imported
Gpg: no ultimately trusted keys found
Gpg: Total number processed: 1
Gpg: imported: 1 (RSA: 1)
Create a file:/etc/apt/sources. list. d/10gen. list
The content is:
Deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
Update it now:
Apt-get update
The following command can install the latest MongoDB version.
Apt-get install mongodb-10gen
After the installation is complete, the configuration file is:
/Etc/mongodb. conf
The path of the database file is/var/lib/mongodb.
Log File Path:/var/log/mongodb/mongdb. log
The service script has been installed:
/Etc/init. d/mongodb
Mongodb has been started automatically.
Service mongodb start | stop | restart.
Official documentation in: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
Take a look from time to prevent changes.
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2