Installation of MongoDb on Ubuntu 22.04

Hello.

I am trying to install Mongodb in Ubuntu22.04 but it is not working. Can anyone from the community tell me that, is it possible to install mongodb in Ubuntu 22.04? As , I was trying to solve this problem, I hadlooked a lot of online documentations and support where people mentioned that it is not possible to use the db with ubuntu 22.04.
Like first some kind of impish security file Release was giving error e.g., file format is not valid and
‘404: IP not found.’ Then I removed that whole file as I thought it might be of different previous versions. But in the end, got other errors and a lot of complications…

Are there other methods?
Like using Atlas or some kind of containerization using Dockers?

As one of the other methods I tried using MongoDB Atlas and trying to connect the atlas server through VS-Code, but the connection never occurs despite of using the right connection string from the hosted server…

Any suggestions or help will be welcomed:)
Thanks.

Atlas with Vscode should work.What error are you getting
Check this link

Also check our forum threads for alternative solutions for Mongodb on Ubuntu 20.04

1 Like

Thanks for replying.

The problem is with IP address. It was not whitelisted before. I changed the setting. And now it is working.
Thanks.

Hi!

It will soon be a year since the stable version of ubuntu 22.04 came out and still mongo db does not support it. Please tell me if the developers plan to support mongo db for ubuntu at all? It seems that the developers of mongo db do not care about ubuntu support

1 Like

Related Installing mongodb over Ubuntu 22.04 - #7 by Stennie

The JIRA tickets are completed so it should be possible to install following instructions in that thread.

I don’t know the reasons why it’s not in the docs yet.

I tried and replacing the last MongoDB installation commands for ubuntu 20.04 focal with with jammy installed the program.

Edit: as said above, and by @chris (below) here is the link to instructions. @chaosmos.

Could you point out here exactly how i can now install mongo db on ubuntu 22.04? There are so many different options in the thread you mentioned that it is not clear which one is working and optimal

Also, could you tell me when we should expect an official release with support for ubuntu 22.04? And what is the reason for the fact that for almost a year it is impossible to install mongo db on the most popular Linux distribution in a regular way?

@chaosmos please check this recent shorter discussion we had:
How to install mongodb 6.0 on Ubuntu 22.04 - Ops and Admin / Installation & Upgrades - MongoDB Developer Community Forums

“Fast release cycles” of operating systems favor the latest versions of libraries (ubuntu comes every 6 months). unfortunately, “latest” does not always mean proven to be “stable” or easy to migrate. Stability is important for server programs like MongoDB so they have to use battle-tested libraries (even if they may have bugs) hence the delay of support to newer OS versions.

The fortunate thing is older libraries can still be installed and used mostly without any problems if all their dependencies can also be installed. you just need to dive into some settings manually. that is until developers manage to migrate to new libraries, which MongoDB also did but that is not just reflected in documents yet.

Follow the existing instructions. Replace focal with jammy.

Done.

2 Likes

Thank you. This worked perfectly for me.

Hi Chris please I am completely a newbie to MongoDB but I am using ubuntu 22.04, could you help me with the clear steps to install the latest MongoDB

As per @santimir:

The instructions are here

Step 2: Is where focal needs to be replaced withjammy. When you copy and paste that line

So that would become:

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

Just switch back to ubuntu 20.04 or some fedora or arch. Or learn and use docker instead. because this is only one package(mongoDB). God knows how many more softwares are not supported in 22.04 (They have done many critical upgrades like wayland, libssl1 → libssl3, etc. Wait a year or so for everything get supported in ubuntu 22.04 and based distros( like popos, mint, distros).
Happy coding fella:)

actually, it is not that easy (or complicated, depending on where you look at it) as you describe.

you can use any version of any library (even 30 years old ones) as long as their dependencies do not contradict what the current OS uses, provided they work with the architecture.

Ubuntu 22.x is called “jammy” and installs packages with that name. but you can still install packages from older (bionic, focal, trusty etc.) repositories if you need them. You just need to add their repository url to the apt source list file. the same also goes for independent packages like MongoDB: they have their own repository urls you need to add to apt source list.

Here in this topic, installing MongoDB 6.0 on Ubuntu 22.x, we have two options:

  • add one of older ubuntu repositories to your apt list (then follow remaining steps):

    • echo "deb http://security.ubuntu.com/ubuntu focal-security main" | sudo tee /etc/apt/sources.list.d/focal-security.list
  • wait for a new build (which is already here) and use it (@chris mentioned this many times)

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

The first method uses MongoDB built for “ubuntu/focal” and the second one uses “ubuntu/jammy” build. The only thing missing is the official installation page does not yet have this on it.

One can easily see which versions have been built for which ubuntu here: MongoDB Repositories. If you follow “Parent Directory” link, you can even find builds for other Linux distros there.

As you said the mongoDb server uses dependency libss1 which is upgraded to libssl3 in ubuntu 22.04. So I have to install this dependency externally which opens several velnerabilities and result in breaking system. Since there is some point in canonical’s decision to depricate libssl1

1 Like