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.
即使我更新了 repo,我也收到了这个错误
: sudo apt-get update
我也确实检查过是否有破损的包裹
: sudo apt-get check
我在 Linux 中安装 mongodb 的步骤:
1) sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
2) echo "deb <a href="http://repo.mongodb.org/apt/debian" rel="noreferrer noopener nofollow">http://repo.mongodb.org/apt/debian</a> 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
还是报同样的错。我该如何解决这个问题?
最佳答案
I guess this is the problem that you are facing. enter image description here
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
关于linux - 在 linux 中安装 mongodb 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50375979/