Installing mongodb over Ubuntu 22.04

for me below was worked.

echo “deb Index of /ubuntu focal-security main” | sudo tee /etc/apt/sources.list.d/focal-security.list
sudo apt-get update
sudo apt-get install libssl1.1

Finally! Below Solutions worked for me

It is because of the missing dependencies mongodb not installing on ubuntu 22.04.
The main reason is the missing of libssl1.1 dependency. So we need to install it seperately.

1.sudo apt install dirmngr gnupg apt-transport-https ca-certificates software-properties-common

2.echo "deb impish-security main" | sudo tee /etc/apt/sources.list.d/impish-security.list

3.Go to root user sudo -i then paste this wget

4.apt update

5.apt install libssl1.1

6.wget -qO - | sudo apt-key add -

7.echo "deb [ arch=amd64,arm64 ] focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list

8.apt update

9.apt install -y mongodb-org

The latest version of mongodb will be installed
To start it

1.systemctl enable mongod

2.systemctl start mongod

In case MongoDB doesn’t start run the command below to reload.

systemctl daemon-reload


I have been using ubuntu in 20.04 and now I want to use it in 22.04 but the actual support of mongodb for Ubuntu 22.04 isn’t released yet. Any reason why the delay of the release for Ubuntu 22.04.

I was able to easily install mongosh on Linux Mint 21. It should be the same instructions for Ubuntu 22.04:

sudo curl | gpg --dearmor >/usr/share/keyrings/mongodb-key.gpg

echo "deb [ arch=amd64,arm64 ] jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list

sudo apt update

sudo apt install mongodb-mongosh
1 Like

Nice workaround!! I’ll take it. Sounds like you’ve understood the impacts of the replaced dependencies.

This worked for me.
But my concern is I am not able to open mongodb shell using in terminal i tried both the commands,
mongo : showing Command ‘mongo’ not found
mongodb : showing this error.

Please let me know how to use mongodb shell in ubuntu 22.04.
I checked the status of mongodb its showing active.

Sandip R.

The mongo command line shell is no longer available in MongoDB 6.0. You want to use the newer mongosh shell. It should have been installed when you installed MongoDB, but if not you can download it separately.

The screenshot shows you ran the mongod command. This is the MongoDB database engine process. Since the process was already running using the defaults, a second instance could not be started and should have failed with a message in the logs similar to Address already in use.

Do you have an estimation when mongo v6.2 will be released?

This one is worked for me .
Thank You!!

Step 5 does not work for me.

apt install libssl1.1
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
Package libssl1.1 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package ‘libssl1.1’ has no installation candidate

Package libssl1.1 is not available, but is referred to by another package

How are you guys getting past this?

I was able to manually download and install the libssl1.1 package:

sudo dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb

Having said that though, this package has been deprecated in Ubuntu 22.04 which is why it’s not available anymore.

SERVER-62300 has been marked as CLOSED at the end of last month, so hopefully there will be a native Ubuntu 22.04 method of installation soon.

@Stennie_X, can you check with the team to see when Ubuntu 22.04 will be able to install MongoDB without jumping through hoops?


yep exactly, seeing so many workarounds is a recipe of disaster indeed

1 Like


Is MongoDB v4.0 supported on Ubuntu 22.04 (Jammy) ?


Hello @Aniruddha_Kulkarni and welcome to the MongoDB Community forums! :wave:

MongoDB 4.0.x is no longer supported on any platform. That version reached end of life in April of this year. Check out the MongoDB Software Lifecycle Schedules page to see how long each version will be supported for.

1 Like

Hi @Doug_Duncan

I understand that it is end of life, but I was curious to know if it is even technically possible to have a MongoDB 4.0 instance running on Ubuntu Jammy?


Is it possible to run MongoDB 4.0 on Ubuntu 22.04? Yeah, pretty much anything is possible if you’re determined.

Is it recommended? Nope.

I just downloaded the generic Linux tarball, expanded it and ran it. This means that it’s not installed as you would expect when installing a .deb package and therefor I have to manually start and stop the process. I also have to create the users and data/log folders and make sure everything else is properly set up. Being that this is not an Ubuntu specific version, there might be performance issues. Also note that by running the older version, I’m missing out on all of the new features, performance improvements, security updates, etc of the new versions.

Now having said that, you were probably asking if one is able to apt install ... version 4.0. Given enough time I might even be able to install outdated packages to make the 4.0 version install that way, but why would I want to spend time on basically breaking my system, when I could be doing something fun and productive?

Once you have to start downloading deprecated packages on to your system, you need to ask yourself if what you’re trying to do is the right thing. Packages get deprecated for many reasons, and one of those is for security. openssl, like other software, has had its share of vulnerabilities. You’re taking a chance that there isn’t a vulnerability that could expose your system to being hacked. Sure newer versions of the package will have issues as well, but those will be actively patched and updated while the deprecated versions are left to rot in their current state.

1 Like

Any hope for MongoDB 5.0.x on 22.04?

Looking at the JIRA ticket mentioned a couple of times earlier in the thread we see the following:

Only v6.0 is listed in the Backport Requested section. :frowning:

I don’t know how much work it would take to get 5.0.x packages, but based on past history I would like to think that they would be able to get this version working on 22.04 as well, especially since 5.0 will be supported until October of 2024. This means the next LTS version of Ubuntu (24.04) will be out before support on the 5.0.x line ends. There is even hope that 4.4 will be supported on Ubuntu 22.04.

Now having said that, I am just a community member like you, and the above is only my thoughts on what might happen. We’ll have to await word from one of the MongoDB team members to know what the official plans are.


Is there a official date for 22.04 release

1 Like