在Linux中安装MongoDB时出错

flvtvl50  于 2022-09-18  发布在  Linux
关注(0)|答案(4)|浏览(332)
The following packages have unmet dependencies:
 mongodb-org-mongos : Depends: libssl1.0.0 (>= 1.0.1) but it is not   installable
 mongodb-org-server : Depends: libssl1.0.0 (>= 1.0.1) but it is not installable
 mongodb-org-shell : Depends: libssl1.0.0 (>= 1.0.1) but it is not installable
 mongodb-org-tools : Depends: libssl1.0.0 (>= 1.0.1) but it is not installable
E: Unable to correct problems, you have held broken packages.

即使我更新了回购:sudo apt-get update,也收到此错误

此外,我还检查了是否有损坏的 Package 盒:sudo apt-get check

在Linux上安装MongoDB的第一步:1)sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5

2)echo "deb d1c0c1d wheezy/mongodb-org/3.6 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list

3)sudo apt-get update

4)sudo apt-get Install-y MongoDB-org

但仍然得到相同的错误。我怎么才能解决这个问题?

nbewdwxp

nbewdwxp1#

在安装MongoDB时,我也收到以下错误

mongodb-org-mongos : Depends: libssl1.1 (>= 1.1.0) but it is not 
 installable
 mongodb-org-server : Depends: libssl1.1 (>= 1.1.0) but it is not 
 installable
 mongodb-org-shell : Depends: libssl1.1 (>= 1.1.0) but it is not installable
 E: Unable to correct problems, you have held broken packages.

以下是使用以下命令解决此类问题的方法

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
v1uwarro

v1uwarro2#

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

添加完libssl1.1后,请遵循MongoDB安装手册
https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/

2mbi3lxu

2mbi3lxu3#

在我的例子中,我使用的是Linux Mint 17->Ubuntu 14.04,而我安装的是Ubuntu 16.04,导致了这个冲突。

在尝试这些命令之前,请检查您的Ubuntu/Debian版本--wiki是一个有用的资源。

如果这还不能解决问题,那就运行

sudo apt purge mongod* 
sudo apt purge mongodb* 
sudo apt purge mongodb-org*

这应该会消除任何不一致,然后转到https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/并遵循该过程。

这解决了问题。

h43kikqp

h43kikqp4#

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.
  • 您可以尝试以下步骤在Ubuntu中安装任意版本的MongoDB:*
sudo apt update

sudo apt upgrade

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

sudo apt-get update

sudo apt-get install -y mongodb-org
  • 现在您可能会看到类似上述截图的错误。尝试以下步骤:*
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb

sudo dpkg -i libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb
  • 现在,MongoDB已经准备好安装。再次运行以下安装命令:*

sudo apt-get install -y mongodb-org

  • 要检查MongoDB版本,请运行以下命令:*

mongod --version

enter image description here

相关问题