1.apt安装方式
Configure Package Management System (APT)
The Ubuntu package management tool (i.e. dpkg and apt) ensure package consistency and authenticity by requiring that distributors sign packages with GPG keys. Issue the following command to import the 10gen public GPG Key:
Create a /etc/apt/sources.list.d/10gen.list file and include the following line for the 10gen repository.
Now issue the following command to reload your repository:
Install Packages
Issue the following command to install the latest stable version of MongoDB:
When this command completes, you have successfully installed MongoDB! Continue for configuration and start-up suggestions.
2.手动安装方式
安装python driver
sudo apt-get install python-dev
sudo apt-get install python-setuptools
sudo apt-get install python-pip
sudo pip install mongo
sudo pip install --upgrade mongo
安装mongo
下载文件,解压后把bin下到文件都拷入/usr/local/bin
创建/data/db,并修改777权限