无法在ubuntu 22.04中安装mongodb(mongodb-org,libssl1.1)

ryhaxcpt  于 2023-01-01  发布在  Go
关注(0)|答案(2)|浏览(1169)

按照MongoDB官方网站上的安装说明进行安装。

  • 安装mongodb-org包时出现以下错误
sudo apt 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
 mongodb-org-shell : Depends: libssl1.1 (>= 1.1.1) but it is not installable
E: Unable to correct problems, you have held broken packages.
  • 我尝试使用apt安装libssl1.1软件包,但我无法这样做,它抛出以下错误。
E: Package 'libssl1.1' has no installation candidate

请来人帮忙。

eblbsuwk

eblbsuwk1#

mongodb似乎需要特定版本的libssl1.1
  • 你可以下载那个版本的debian文件并使用下面的命令安装。最有可能的是它会解决这个问题。
sudo wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb
rjee0c15

rjee0c152#

经过几个小时寻找一个我满意的解决方案,我终于偶然发现了一个!希望这能帮助其他任何希望安装MongoDB社区版而不牺牲安全性的人使用libssl 1. 1(这里的解决方案使用〉3. 0。
MongoDB隐藏了Ubuntu 22.04.1 LTS(Jammy Jellyfish)的存储库。在我发布这篇文章的时候,它肯定还没有出现在文档安装页面上。自己去看看吧:https://repo.mongodb.org/apt/ubuntu/dists/jammy/mongodb-org/
下面的代码将添加存储库并在您的系统上安装最新的mongodb-org:

sudo apt-get install wget gpg
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --dearmor > packages.mongodb.gpg
sudo install -D -o root -g root -m 644 packages.mongodb.gpg /etc/apt/keyrings/packages.mongodb.gpg
echo "deb [ arch=amd64,arm64 signed-by=/etc/apt/keyrings/packages.mongodb.gpg] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
rm -f packages.mongodb.gpg
sudo apt-get install -y mongodb-org

相关问题