16ar
16ar

Reputation: 175

Can't install mongodb on debian

I use debian v.12.5.

I followed the documentation here but after sudo apt-get install -y mongodb-org I get this 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
E: Unable to correct problems, you have held broken packages.

I naively tried to install libssl1.1 with sudo apt-get install libssl1.1 but I get this :

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

Any solution would be greatly apreciated thanks !

Upvotes: 0

Views: 1617

Answers (1)

Kiki odazie
Kiki odazie

Reputation: 124

In the docs the "Create a /etc/apt/sources.list.d/mongodb-org-7.0.list file for MongoDB." section of the docs has command for Debian 11 "Bulleye" and not Debian 12.5 bookworm.

So after importing the MongoDB public GPG key, with the following command:

curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | \
   sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg \
   --dearmor

Create the file list with:

echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] http://repo.mongodb.org/apt/debian bookworm/mongodb-org/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list

The difference is that the above says bookworm instead of bullseye referen to the repo here

Then reload the package database:

sudo apt-get update

and install:

sudo apt-get install -y mongodb-org

Let me know if this works.

Upvotes: 2

Related Questions