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

San*_*ain 11 mongodb ubuntu-22.04

按照 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.
Run Code Online (Sandbox Code Playgroud)
  • 我尝试使用 apt 安装libssl1.1软件包,但无法这样做,它会引发以下错误。
E: Package 'libssl1.1' has no installation candidate
Run Code Online (Sandbox Code Playgroud)

请有人帮忙。

San*_*ain 37

看来 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
Run Code Online (Sandbox Code Playgroud)