MongoDB安装:解决sudo apt-get install -y mongodb-org出现的问题

安装MongoDB的时候,遇到了很棘手的问题,卡在这里很久了,看着官方文档一步一步来的,但是安装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.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.

mad!

把报错信息Google之,结果那些答案根本没法解决问题。搜着搜着,我突然在官方文档发现了一个问题,他说有些Ubuntu版本已在3.6+退出支持。我立马想到,是不是我的这个问题也是因为自己Ubuntu的版本和MongoDB不适配导致的问题?

于是我查看了自己Ubuntu的版本

lsb_release -a

得到:
在这里插入图片描述

是22.04.1版本。

再看官方教程给的那个4.6.2,好像根本就不支持???

所以这回搜索的时候就明确了,搜Ubuntu 22.04 安装 MongoDB,找到了这篇宝藏,实测可行,在此特别感谢!

另外吐槽一下,MongoDB官方文档多久没更新了,这种问题居然不多出一篇教程来解释一下,误导小白。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值