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
sudo apt-get purge mongodb-org*
sudo rm -r /var/log/mongodb
sudo rm -r /var/lib/mongodb
Then start installing with the following commands:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
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
sudo apt-get update
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
Raising Hard Limit on Rlimit_Nofile System-Wide on Linux
What Are The Lowest Possible Permissions for Typo3
Gnu Octave, Round a Number to Units Precision
How to Write Kernel Space Memory (Physical Address) to a File Using O_Direct
How to Create a Core File for My Crashed Program
Bash Script: Can Not Properly Handle Sigtstp
Tar Command Changing The Owner:Group While Extracting
Human Readable, Recursive, Sorted List of Largest Files
Is Overwriting a Small File Atomic on Ext4
Write and Read from Ttyusb0, Can't Get Response
How Existing Kernel Driver Should Be Initialized as Pci Memory-Mapped
How to Edit a Symlink with a Text Editor
How to Redirect Entire Output of Spark-Submit to a File
How to Manage Permissions When Developing in a Docker Container