LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 06-15-2023, 09:46 AM   #1
naarter
Member
 
Registered: Mar 2022
Distribution: Slackware
Posts: 161

Rep: Reputation: 3
Post MongoDB gpg and repository not working full [Dumb question but needed]


I am trying to install and set up mongodb which you probably already know is difficult as it is. I am running Debian 12 and decided to use it as my main driver whether I like it or not until Debian 13 comes out because I am sick of switching distro's. I ran the following:

Code:
root@mia:/home/noach# sudo apt-get install gnupg
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
gnupg is already the newest version (2.2.40-1.1).
0 upgraded, 0 newly installed, 0 to remove and 67 not upgraded.
root@mia:/home/noach# curl -fsSL https://pgp.mongodb.com/server-6.0.asc | \
   sudo gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg \
   --dearmor
root@mia:/home/noach# sudo apt-get install -y mongodb-org

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package mongodb-org
root@mia:/home/noach# echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg] http://repo.mongodb.org/apt/debian bullseye/mongodb-org/6.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
deb [ signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg] http://repo.mongodb.org/apt/debian bullseye/mongodb-org/6.0 main
root@mia:/home/noach# sudo apt-get update
Hit:1 https://deb.nodesource.com/node_20.x bookworm InRelease
Ign:2 http://repo.mongodb.org/apt/debian bullseye/mongodb-org/6.0 InRelease    
Hit:3 http://plug-mirror.rcac.purdue.edu/debian bookworm InRelease             
Hit:4 http://plug-mirror.rcac.purdue.edu/debian bookworm-updates InRelease     
Get:5 http://repo.mongodb.org/apt/debian bullseye/mongodb-org/6.0 Release [2,036 B]
Get:6 http://repo.mongodb.org/apt/debian bullseye/mongodb-org/6.0 Release.gpg [801 B]
Hit:7 http://apt.postgresql.org/pub/repos/apt bookworm-pgdg InRelease          
Hit:8 https://packages.microsoft.com/repos/vscode stable InRelease             
Get:9 http://repo.mongodb.org/apt/debian bullseye/mongodb-org/6.0/main amd64 Packages [23.9 kB]
Ign:10 http://security.debian.org/debian-security bookworm-security InRelease  
Ign:10 http://security.debian.org/debian-security bookworm-security InRelease
Ign:10 http://security.debian.org/debian-security bookworm-security InRelease
Err:10 http://security.debian.org/debian-security bookworm-security InRelease
  Connection failed [IP: 199.232.162.132 80]
Fetched 26.8 kB in 2min 37s (170 B/s)
Reading package lists... Done
W: Failed to fetch http://security.debian.org/debian-security/dists/bookworm-security/InRelease  Connection failed [IP: 199.232.162.132 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.
N: Repository 'Debian bookworm' changed its 'firmware component' value from 'non-free' to 'non-free-firmware'
N: More information about this can be found online in the Release notes at: https://www.debian.org/releases/bookworm/amd64/release-notes/ch-information.html#non-free-split
root@mia:/home/noach# sudo apt-get install -y mongodb-org
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.
root@mia:/home/noach#
I created a small guide to follow and tell me if it is correct but I suppose:

1. **Import the MongoDB public GPG Key:**

MongoDB packages are signed with the MongoDB public GPG Key. GPG keys ensure that the packages are authentic and have not been tampered with. You need to import this key. Run the following command:

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

This command retrieves the MongoDB GPG key and adds it to your apt sources.

2. **Create a list file for MongoDB:**

You need to point apt to the official MongoDB repository. Do this by creating a new source list file for MongoDB. Issue the following command:

```bash
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
```

Here, we're telling apt that we want to use the MongoDB repository. This command creates a new source list file for MongoDB at `/etc/apt/sources.list.d/mongodb-org-4.4.list`.

3. **Reload local package database:**

Now you need to reload the local package database to include the MongoDB repository. You do this with the following command:

```bash
sudo apt-get update
```

4. **Install MongoDB:**

Now, you can install MongoDB. To do so, run the following command:

```bash
sudo apt-get install -y mongodb-org
```

This command installs the latest stable version of MongoDB. If you want to install a specific version, replace `mongodb-org` with `mongodb-org=4.4.10` (or your desired version).

5. **Start MongoDB:**

MongoDB doesn't start automatically after it's installed. To start it, use the following command:

```bash
sudo systemctl start mongod
```

If you also want MongoDB to start when your system boots, use this command:

```bash
sudo systemctl enable mongod
```

6. **Verify MongoDB is running:**

You can verify that MongoDB has started successfully by checking the status:

```bash
sudo systemctl status mongod
```

If MongoDB started successfully, the `mongod` status message displays `active (running)`.

7. **Issues that could arise:**

- If the MongoDB GPG key does not get imported properly, you will get an error when you try to reload the package database or install MongoDB. Always ensure that the key import command does not return any errors.

- If MongoDB does not start, or it fails to enable at boot, check the MongoDB logs for any error messages. The logs are typically located in `/var/log/mongodb/`.

- When installing MongoDB, if you get an error that the package `mongodb-org` could not be found, it could mean that the MongoDB repository is not in your source list, or the package database has not been updated.

By following these steps, you should have MongoDB installed and running on your Debian system.


This is not the first time I got errors related to gpg keys and the repository and I think with Debian 12 being very new it may pose an issue. What is your opinion on why this isn't working?
 
Old 06-15-2023, 10:00 AM   #2
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,605

Rep: Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548

What's with all the bold text, asterisks, and triple backticks?

The documentation one should follow for installing MongoDB on Debian is:
https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-debian

The key bit of that page is:
Quote:
MongoDB 6.0 Community Edition supports the following 64-bit Debian releases on x86_64 architecture:

Debian 11 "Bullseye"

Debian 10 "Buster"
i.e. Debian 12 is not supported.

You need to raise an issue with MongoDB Inc and ask them to provide Debian 12 support.

(Or switch to software that comes native with Debian.)


Last edited by boughtonp; 06-15-2023 at 10:03 AM.
 
Old 06-15-2023, 03:04 PM   #3
naarter
Member
 
Registered: Mar 2022
Distribution: Slackware
Posts: 161

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by boughtonp View Post
What's with all the bold text, asterisks, and triple backticks?

The documentation one should follow for installing MongoDB on Debian is:
https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-debian

The key bit of that page is:


i.e. Debian 12 is not supported.

You need to raise an issue with MongoDB Inc and ask them to provide Debian 12 support.

(Or switch to software that comes native with Debian.)

Ugh, do you honestly think mongodb won't be supported in Debian lol? Debian is only a few days old. From a technical point of view what do you think? Like, idk,
 
Old 06-16-2023, 08:34 AM   #4
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,605

Rep: Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548

I did not say it wont be supported.

The documentation states that MongoDB 6 is supported in Debian 10 and Debian 11. It does not list Debian 12. I have no idea whether that will change.

Your attempt to install it from Mongo's Buster or Bullseye packages fails because, as the error text states, those packages have dependencies that do not exist in Debian 12. MongoDB Inc have chosen not to release a MongoDB package for Bookworm (Debian 12).

Debian is not only a few days old. Debian Bookworm has been available for testing for close to two years, it was frozen six months ago to give plenty of time for those wanting to support it to test their software and finalize any necessary changes regarding package versions. The June release date was confirmed back in April.

In other words, there has been enough opportunity for MongoDB Inc to prepare a Bookworm package before Debian 12 was released, but they have not done that.

Will they do it eventually? Who knows? The developers of the software know. If you want to know too, you should ask the developers of the software. i.e. Mongo Inc.


Ultimately there are three options:
* Do nothing and hope the situation changes.
* Try to accelerate things, by making sure the developer is aware of the issue, and that people care about it.
* Use alternative software.

Putting the error into a search engine shows the same failed dependency occurred when Ubuntu 22.04 LTS was released - it was about six months before an updated package was released for that. (I wonder what proportion of that time was because nobody reported the issue...?)


Last edited by boughtonp; 06-16-2023 at 09:04 AM.
 
  


Reply

Tags
curl, debian, gpg, linux



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: AWS DocumentDB not MongoDB-compatible, says MongoDB Inc LXer Syndicated Linux News 0 12-07-2021 06:05 AM
gpg / gpg-agent -- Can't connect to /root/.gnupg/S.gpg-agent jrtayloriv Linux - Security 9 06-03-2019 10:06 AM
MQTT mosquitto connecting to Node.js and MongoDB but i can not see output istabraq Linux - Desktop 1 12-17-2016 10:15 PM
GPG: Bad session key gpg between gpg on linux and gpg gui on windows XP konqi Linux - Software 1 07-21-2009 09:37 AM
Installing Fedora blind, deaf, and dumb. Well, not dumb. Irving Fedora 2 07-18-2006 06:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration