Reprinted from Http://www.cnlamp.org/linux/417.html
Posted 2 years ago ⁄linux⁄ No Comments
Since the version of MongoDB in the official Ubuntu apt source is older, it is installed with the APT source provided by MongoDB. To use the software on a third-party source, in addition to adding the corresponding source on the sources.list, you have to add the corresponding public key key to properly install the software.
add MongoDB's public key to local key database via Apt-key
sudo apt-key adv--keyserver keyserver.ubuntu.com--recv 7f0ceb10
Add a software source officially provides two software sources, one is the SYSV-style startup script, and the other is the upstart-style startup script. I use the SYSV style here, the current working principle of upstart is not familiar.
Here I give the two styles of software source, please adjust according to the actual situation.
#SysV style
Deb Http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen
#Upstart
Deb Http://downloads-distro.mongodb.org/repo/ubuntu-upstart Dist 10gen
edit/etc/apt/sources.list, add MongoDB software source vi/etc/apt/sources.list
#增加下面的软件源
Strong>deb http://downloads-distro.mongodb.org/repo/debian-sysvinit Dist 10gen
installation mongodb< /strong> #更新本地软件包列表信息
apt-get update
#安装MongoDB
apt-get Install mongodb-10gen