0

First I used the documentation of Ubuntu. https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/

Step1: After that I ran commands according to documentation.

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

I got the following result:

Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).

OK

After that I used the command to upgrade and update everything.

After that I ran:

sudo apt-get install -y mongodb-org

I got error:

Reading package lists... Done Building dependency tree... Done Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mongodb-org-mongos : Depends: libssl1.1 (>= 1.1.1) but it is not installable
 mongodb-org-server : Depends: libssl1.1 (>= 1.1.1) but it is not installable
 mongodb-org-shell : Depends: libssl1.1 (>= 1.1.1) but it is not installable
E: Unable to correct problems, you have held broken packages.

How can I solve this issue??

  • Wonder why they didn't migrate this to Ubuntu but try these commands basically sudo apt-get update and sudo apt-get install libssl1.1: https://askubuntu.com/questions/1403619/mongodb-install-fails-on-ubuntu-22-04-depends-on-libssl1-1-but-it-is-not-insta – Vomit IT - Chunky Mess Style Jul 03 '22 at 02:15

1 Answers1

0

Check out this writeup by priamcse, it solved this issue for me.

https://www.junktheme.com/e-unable-to-correct-problems-you-have-held-broken-packages-mongodb-installation-ubuntu-22-04/

I first had to install curl with the following command:

sudo snap install curl  # version 7.86.0

After, I referred to his page by executing the following cmds:

Install libSSL

curl -LO http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb

sudo dpkg -i ./libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb

Install Mongodb

sudo apt install -y mongodb-org

Check version

mongod -version

Let me know if it fixes your issues.