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

Hello everyone,

I have been trying to install mongodb following the official documentation. So I followed these steps:

STEP 1:

wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -

STEP 2:

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

STEP 3:

sudo apt-get update

When I reach this step:

STEP 4:

sudo apt-get install -y mongodb-org

This error gets thrown.

E: Unable to locate package mongodb-org

I looked it up all over the internet and I couldn’t find any solution even though it has been asked several times;

After doing some research, I have found this stackoverflow question where most answers say that I should just:

At first try with this command: sudo apt-get install -y mongodb

This is the unofficial mongodb package provided by Ubuntu and it is
not maintained by MongoDB and conflict with MongoDB’s offically
supported packages.

But, this seems to be an outdated answer which explains when I tried to do mongodump using the installed mongodb with that approach, it did not work.


After using the Outdated approach, this the installed mongodb info. I do understand they’re outdated.

mongo --version
MongoDB shell version: 2.6.10

mongod --version
db version v2.6.10

This is the system info.

hostnamectl
Operating System: Ubuntu 16.04.7 LTS
Kernel: Linux 4.4.0-210-generic
Architecture: x86-64

I would really appreciate any help.

You’ll need to use MongoDB v4.4 on Ubuntu 16.04 as Ubuntu 16.04 support is dropped in version 5.0+

v4.4 Edition of the manual:

3 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.