安装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官方文档多久没更新了,这种问题居然不多出一篇教程来解释一下,误导小白。