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

I am getting this error even i did update the repo : sudo apt-get update

also i did check if there any broken packeges with : sudo apt-get check

step i took to install mongodb in linux: 1) sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5

2) echo "deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.6 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list

3)sudo apt-get update

4)sudo apt-get install -y mongodb-org

but still getting the same error. how can i solve this?

8
  • did you run apt-get purge?? Commented May 16, 2018 at 17:16
  • yes i did and it is not installing any new packeges Commented May 16, 2018 at 17:17
  • or is there any other way to install these dependencies manually? Commented May 16, 2018 at 17:28
  • Follow these steps stackoverflow.com/questions/50371473/… Commented May 16, 2018 at 17:35
  • no it is not helping me. i think i need to download software and install it manually any help will be appreciated Commented May 16, 2018 at 17:51

8 Answers 8

14

I guess this is the problem that you are facing. enter image description here

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

E: Unable to correct problems, you have held broken packages.

You can try the following steps to install mongodb in Ubuntu at any version:

sudo apt update

sudo apt upgrade

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

sudo apt-get update

sudo apt-get install -y mongodb-org

Now you may get the error like above screenshot. Try the following steps :

wget 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

Now, mongodb is ready to be installed. Run the following installation command again:

sudo apt-get install -y mongodb-org

To check Mongodb version, run the following command :

mongod --version

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
8

echo "deb http://security.ubuntu.com/ubuntu focal-security main" | sudo tee /etc/apt/sources.list.d/focal-security.list
sudo apt-get update
sudo apt-get install libssl1.1

After adding libssl1.1, follow mongoDB installation manual
https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
8

100% working solution!!!

The below solution worked for me to install mongodb:

  1. Download libssl1.1_1.1.1f-1ubuntu2_amd64.deb:

wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb

  1. Install it using the dpkg command:

sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb

2 Comments

Work like Makhhan Malai :) Thanks
That has a security vulnerability though.
4

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.

1 Comment

In my case i was using Linux Mint [Tara] which uses Ubuntu 18 (Bionic) as its official repository. I had to navigate to Systems Settings -> Administration Tab -> Software Sources to confirm my distribution. Here after, I purged all installed instances on MongoDB using sudo apt purge mongod* sudo apt purge mongodb* sudo apt purge mongodb-org* And navigated to docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu as @KNDheeraj highlighted. It's crucial to confirm your linux distribution when installing MongoDB
4

I'm also getting the following error while installing MongoDB

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

Here is the solution for this kind of issue Use the following command

echo "deb http://security.ubuntu.com/ubuntu impish-security main" | sudo 
tee /etc/apt/sources.list.d/impish-security.list

sudo apt-get update
sudo apt-get install libssl1.1

Comments

2

Ubuntu 22.04 doesn't have official MongoDB packages yet, so the best option now is to have Ubuntu 20.04, where official MongoDB packages are available.

It's NOT recommended to use any workaround in Ubuntu 22.04 to install MongoDB, because it can lead to problems if you gonna use it in production. Below is the workaround that worked for me:

1.Download libssl1.1_1.1.1f-1ubuntu2_amd64.deb from official repository: wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb

2.Install it: sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb

3.Proceed with the installation of MongoDB: sudo apt-get install -y mongodb-org

Comments

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 http://security.ubuntu.com/ubuntu impish-security main" | sudo tee /etc/apt/sources.list.d/impish-security.list

3.Go to root user sudo -i then paste this wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb

4.apt update

5.apt install libssl1.1

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

7.echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu 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

code copied from https://www.mongodb.com/community/forums/t/installing-mongodb-over-ubuntu-22-04/159931/38

Comments

0

Libssl has a CVE as of a month or so ago. We shouldn't be downgrading to older unpatched version of libssl to get mongodb 7.x to run on Ubuntu 22.04

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.