How to install MongoDB 3.6 on Linux Mint 18.3 Sylvia?
Although Ubuntu has its own official MongoDB package, there are chances that we need to install more updated version. As the time of this writing, the latest version of MongoDB available is 3.6. Follow these steps to install MongoDB Community Edition package on Linux Mint 18.3 Sylvia:
- 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 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
- Create a list file for MongoDB.
/etc/apt/sources.list.d/mongodb-org-3.6.listlist file using the command appropriate for your version of Ubuntu:
$ echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
- Reload local package database.
Issue the following command to reload the local package database:
$ sudo apt-get update
- Install the MongoDB packages.
To install the latest stable version of MongoDB, issue the following command:
$ sudo apt-get install -y mongodb-org
- Start MongoDB.
Issue the following command to start
$ sudo service mongod start
- Verify that MongoDB has started successfully.
Verify that the mongod process has started successfully by checking the contents of the log file at
/var/log/mongodb/mongod.logfor a line reading
[thread1] waiting for connections on port <port>
where <port> is the port configured in /etc/mongod.conf,