Error While Installing Mongodb on Ubuntu 16.04

I can’t install mongodb: E: Unable to locate package mongodb-org

The last release of MongoDB for Xenial was MongoDB 4.4, as seen in the software's repository for Xenial. Thus, you won't be able to install MongoDB 5.0 (I assume that's what you are trying to do) from the official repository; however you can install the software using a .tgz Tarball, as specified in Install MongoDB Community on Ubuntu using .tgz Tarball.

Why is it giving me active:failed error while installation of mongodb on my ubuntu 16.04 LTS?

You need to first start mongo server at port 27017.

You can do it by executing following command:

mongod --port 27017 --dbpath [database_path]

Installing MongoDB on Ubuntu 16.04

For updates check here.

Steps to install MongoDB Community Edition on Ubuntu 16.04

Run these commands in Terminal (Ctrl + Alt + T):

To remove an already installed MongoDB

  1. sudo apt-get purge mongodb-org*

  2. sudo rm -r /var/log/mongodb
    sudo rm -r /var/lib/mongodb

Then start installing with the following commands:

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

  2. echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list

  3. sudo apt-get update

  4. sudo apt-get install -y mongodb-org

To start MongoDB run:

sudo service mongod start

Unable to install mongodb properly on ubuntu 18.04 LTS

You need to first uninstall the mongodb, you can use:

sudo apt-get purge mongodb-org*

After this, install mongodb through the following commands:

sudo apt-get install mongodb

And then update:

sudo apt-get update

You are done with the installation of mongodb. You can check it by using the below command:

mongo --version

getting Error while installing mongodb in linux

In my case, I'm using Linux Mint 17 -> Ubuntu 14.04 and I was installing with Ubuntu 16.04 resulting in this conflict.

Check your Ubuntu/Debian version - the wiki is a useful resource - before trying these commands.

If that doesn't solve it then run

sudo apt purge mongod* 
sudo apt purge mongodb*
sudo apt purge mongodb-org*

That should remove any inconsistency and then go to https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ and follow the procedure.

This resolved the issue.



Related Topics



Leave a reply



Submit