9

I have Ubuntu 16.04 machine with MongoDB 2.6.10 install.

Now I want to upgrade MongoDB to latest version, i.e., 3.4

What is the best way to Upgrade?

3

1 Answer 1

16

You can do as following

$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6

$ echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list

$ sudo apt-get update
$ sudo apt-get install -y mongodb-org

after upgrading your service will be masked. To unmask it

sudo systemctl unmask mongodb

for more detail see:

update:

If you use different ubuntu version, you should update <UBUNTU VERSION> in this command:

$ echo "deb http://repo.mongodb.org/apt/ubuntu <UBUNTU VERSION>/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list

For example, if you use 18.10, change it to cosmic You can find your version with this command

$ lsb_release -a
3

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .