Upgrading to MongoDB 3.6 on Ubuntu 16.04 LTS
Introduction
This guide shows you how to upgrade your MongoDB to version 3.6 on your Ubuntu server.
Prerequisites
- A running MongoDB.
- Basic knowledge of Linux OS.
Step-by-step guide
-
SSH into your Ubuntu server
-
Import the v3.6 public key used by the package management system
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
-
Create a list file for MongoDB v3.6
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
-
Reload the local package database
sudo apt-get update
-
Update to the latest stable version of MongoDB
sudo apt-get install -y mongodb-org
-
Check the result
mongod --version
You should see "db version v3.6.0"
Conclusion
Congratulations! You now have MongoDB 3.6.0 installed on your Ubuntu server.