How to install and upgrade MongoDB 3.0 in Ubuntu

Source: Internet
Author: User
Tags gpg install mongodb mongodb mongodb version


Because the server uses the source provided by Alibaba Cloud, the MongoDB version installed is too low (it seems to be MongoDB 2.0.4). MongoDB 3.0 has been out for a while. The following describes how to upgrade MongoDB from http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu /. (Original prawns and Tigers)

Import public GPG Key:

Import the public key used by the package management system: The Ubuntu package management tools (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 MongoDB public GPG Key:


Sudo apt-key adv -- keyserver hkp: // keyserver.ubuntu.com: 80 -- recv 7F0CEB10

Add the MongoDB source address to the source

Create a list file for MongoDB: Create the/etc/apt/sources. list. d/mongodb-org-3.0.list list file using the following command:


Echo "deb http://repo.mongodb.org/apt/ubuntu" $ (lsb_release-SC) "/mongodb-org/3.0 multiverse" | sudo tee/etc/apt/sources. list. d/mongodb-org-3.0.list

Update source

Issue the following command to reload the local package database: Reload local package database

Sudo apt-get update
Install MongoDB

Install the MongoDB packages: You can install either the latest stable version of MongoDB or a specific version of MongoDB.

Install the latest stable version of MongoDB


Sudo apt-get install-y mongodb-org

Install a specific version of MongoDB

Specify each component package individually and append the version number to the package name, as in the following example


Sudo apt-get install-y mongodb-org = 3.0.1 mongodb-org-server = 3.0.1 mongodb-org-shell = 3.0.1 mongodb-org-mongos = 3.0.1 mongodb-org-tools = 3.0.1

Finally, you can run the mongo -- version command to view the MongoDB version.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.