无法在ubuntu 22.04中安装mongodb(mongodb org,libssl1.1)



关于MongoDB官方网站的以下安装说明

  • 在安装mongodb-org包时,出现以下错误
sudo apt 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
mongodb-org-shell : Depends: libssl1.1 (>= 1.1.1) but it is not installable
E: Unable to correct problems, you have held broken packages.
  • 我尝试使用apt安装libssl1.1包,但无法安装,它引发以下错误
E: Package 'libssl1.1' has no installation candidate

请有人帮忙。

mongodb似乎需要特定版本的libssl1.1
  • 您可以下载该版本的debian文件,并使用以下命令进行安装。它很可能会解决这个问题
sudo wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb

经过数小时的寻找,我终于找到了一个令我满意的解决方案!希望这能帮助其他希望在不牺牲安全性的情况下安装MongoDB社区版的人使用libssl1.1(这里的解决方案使用>3.0。

MongoDB隐藏了Ubuntu 22.04.1 LTS(Jammy Jellyfish(的存储库。到我发布这篇文章的时候,它肯定还没有出现在文档安装页面上。你自己看看:https://repo.mongodb.org/apt/ubuntu/dists/jammy/mongodb-org/

以下代码将添加存储库并在您的系统上安装最新的mongodb.org:

sudo apt-get install wget gpg
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --dearmor > packages.mongodb.gpg
sudo install -D -o root -g root -m 644 packages.mongodb.gpg /etc/apt/keyrings/packages.mongodb.gpg
echo "deb [ arch=amd64,arm64 signed-by=/etc/apt/keyrings/packages.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
rm -f packages.mongodb.gpg
sudo apt-get install -y mongodb-org

最新更新