无法在 Ubuntu 22.04 上安装 MongoDB

无法在 Ubuntu 22.04 上安装 MongoDB

我正在尝试使用以下命令在 Ubuntu 22.04 上安装 MongoDB:

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.

有办法解决这个问题吗?谢谢!

答案1

一个选项是下载libssl1.1_1.1.1f包并通过终端手动安装:

sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb

答案2

您尝试过这个命令吗?

echo "deb http://security.ubuntu.com/ubuntu impish-security main" | sudo tee /etc/apt/sources.list.d/impish-security.list
sudo apt-get update
sudo apt-get install libssl1.1

参考: https://www.mongodb.com/community/forums/t/installing-mongodb-over-ubuntu-22-04/159931/3

相关内容