ano*_*932 93 package-management apt dependencies 22.04
以下是网站上的标准安装说明:
wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org
Run Code Online (Sandbox Code Playgroud)
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.
Run Code Online (Sandbox Code Playgroud)
我尝试直接安装依赖项,但似乎没有解决问题:
sudo apt install libssl1.1
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libssl1.1 is already the newest version (1.1.0g-2ubuntu4).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Run Code Online (Sandbox Code Playgroud)
Lio*_*nep 109
MongoDB 6.0 现在可以从 Jammy 上的 mongodb 存储库安装,无需 libssl1.1
MongoDb 目前还没有针对 ubuntu 22.04 的官方版本。
Ubuntu 22.04已将libssl升级到3,不建议使用libssl1.1
您可以通过添加 ubuntu 20.04 源来强制安装 libssl1.1:
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
Run Code Online (Sandbox Code Playgroud)
然后使用您的命令安装 mongodb-org。
然后删除刚刚创建的focal-security列表文件:
sudo rm /etc/apt/sources.list.d/focal-security.list
Run Code Online (Sandbox Code Playgroud)
小智 51
Ubuntu 22.04 还没有官方 MongoDB 软件包,因此现在最好的选择是使用 Ubuntu 20.04,其中提供了官方 MongoDB 软件包。
不建议在 Ubuntu 22.04 中使用任何解决方法来安装 MongoDB,因为如果您要在生产中使用它,可能会导致问题。以下是对我有用的解决方法:
libssl1.1_1.1.1f-1ubuntu2_amd64.deb从官方存储库下载:
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
Run Code Online (Sandbox Code Playgroud)
安装它:
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb
Run Code Online (Sandbox Code Playgroud)
继续安装 MongoDB:
sudo apt-get install -y mongodb-org
Run Code Online (Sandbox Code Playgroud)
该解决方案来自MongoDB 论坛,但我还添加了一些注释以供记住。
小智 27
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb
sudo dpkg -i ./libssl1.1_1.1.0g-2ubuntu4_amd64.deb
rm -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb
Run Code Online (Sandbox Code Playgroud)
128*_*8KB 16
新的官方(且安全)解决方案是:
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb.gpg > /dev/null
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/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
sudo apt update
sudo apt install mongodb-org
Run Code Online (Sandbox Code Playgroud)
编辑:来源
小智 5
@yehuda建议libssl1.1_1.1.0g哪个不符合依赖性标准>=1.1.1。扩展了这种方法,我尝试了以下方法并且它有效。
从http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/下载其中任何一个
我选择libssl1.1_1.1.1l-1ubuntu1.3_amd64.deb,因为我之前在 Impish(21.10) 中使用过它
cd ~/Downloads
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1l-1ubuntu1_amd64.deb
sudo dpkg -i ./libssl1.1_1.1.1l-1ubuntu1_amd64.deb
rm -i libssl1.1_1.1.1l-1ubuntu1_amd64.deb
Run Code Online (Sandbox Code Playgroud)