在 Ubuntu 20.04 中安装 mongoDB 失败 [英] Failed to install mongoDB in Ubuntu 20.04

查看:57
本文介绍了在 Ubuntu 20.04 中安装 mongoDB 失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在 ubuntu 20.04 上安装 MongoDB,使用的命令如下,

<块引用>

在sources.list.d文件夹中创建一个mongodb-org-4.4.list文件

echo deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focus/mongodb-org/4.4 multiverse"|须藤三通/etc/apt/sources.list.d/mongodb-org-4.4.list

<块引用>

更新了系统,

sudo apt-get 更新

<块引用>

在我的系统上安装 MongoDB,

sudo apt install mongodb-org

运行上述命令后,我刚刚遇到一个错误,它没有安装在 ubuntu 系统中,错误如下,请关注谁想帮助我,

正在读取包列表...完成构建依赖树读取状态信息...完成mongodb-org 已经是最新版本 (4.4.5).您可能需要运行 'apt --fix-broken install' 来纠正这些问题.以下软件包具有未满足的依赖项:mongodb-org : 取决于: mongodb-org-server 但它不会被安装取决于:mongodb-org-mongos 但​​它不会被安装mongodb-org-tools :取决于:mongodb-database-tools 但它不会被安装E:未满足的依赖项.尝试不带软件包的apt --fix-broken install"(或指定解决方案).

注意:错误也在附件中添加.

解决方案

试试这个

wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc |sudo apt-key 添加 -echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focus/mongodb-org/4.4 multiverse";|须藤三通/etc/apt/sources.list.d/mongodb-org-4.4.listsudo apt-get 更新sudo apt-get install -y mongodb-org

I tried to install MongoDB on the ubuntu 20.04 and the used command are given below,

To create a mongodb-org-4.4.list file in the sources.list.d folder

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list

Updated the system,

sudo apt-get update

Install the MongoDB on my system,

sudo apt install mongodb-org

After running the above command I just faced an error and it was not install in ubuntu system and the error is given below, please concern who wanna to help me,

Reading package lists... Done
Building dependency tree       
Reading state information... Done
mongodb-org is already the newest version (4.4.5).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 mongodb-org : Depends: mongodb-org-server but it is not going to be installed
               Depends: mongodb-org-mongos but it is not going to be installed
 mongodb-org-tools : Depends: mongodb-database-tools but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Note: The error are also added in attached file.

解决方案

Try like this

wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
sudo apt-get update
sudo apt-get install -y mongodb-org

这篇关于在 Ubuntu 20.04 中安装 mongoDB 失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆