1

I'm not able to install mongoDB on my Ubuntu 22.04.

$ sudo apt-get update
$ 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

Then I tried this:

$ sudo apt-get install -y mongodb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package mongodb 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 'mongodb' has no installation candidate
BeastOfCaerbannog
  • 12,964
  • 10
  • 49
  • 77
  • looks similar to this: https://askubuntu.com/questions/842592/apt-get-fails-on-16-04-or-18-04-installing-mongodb – Daniel Jun 29 '22 at 15:59
  • packages.ubuntu.com – lnee Jun 29 '22 at 16:00
  • As the message says, there is no release candidate for mongodb-org. You need to follow the instructions on the MongoDB website to add the release candidate/file lists etc: https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/ – codlord Jun 29 '22 at 17:24
  • 1
    Does this answer your question? [MongoDB Install Fails on Ubuntu 22.04 - Depends on libssl1.1 but it is not installable](https://askubuntu.com/questions/1403619/mongodb-install-fails-on-ubuntu-22-04-depends-on-libssl1-1-but-it-is-not-insta) – Artur Meinild Mar 22 '23 at 11:56
  • 2
    Does this answer your question? [E: Unable to locate package mongodb-org](https://askubuntu.com/questions/606478/e-unable-to-locate-package-mongodb-org) – BeastOfCaerbannog Mar 22 '23 at 12:37

1 Answers1

3

The following commands worked for me:

wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc |  gpg --dearmor | sudo tee /usr/share/keyrings/mongodb.gpg > /dev/null 
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
sudo apt update
sudo apt install mongodb-org
BeastOfCaerbannog
  • 12,964
  • 10
  • 49
  • 77
Alexander
  • 31
  • 2
  • 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](/help/how-to-answer). – Community Mar 22 '23 at 19:20