无法在 ubuntu 18.04 LTS 上正确安装 mongodb [英] Unable to install mongodb properly on ubuntu 18.04 LTS
问题描述
我正在尝试在我的 Ubuntu 18.04 LTS 上安装 mongodb,但出现以下错误
<块引用>您可能需要运行apt --fix-broken install"来纠正这些问题.这以下软件包具有未满足的依赖项: mongodb-org :依赖:mongodb-org-server 但它不会被安装取决于:mongodb-org-mongos 但它不会被安装依赖:mongodb-org-tools 但它不会被安装 E:未满足的依赖.尝试使用apt --fix-broken install"没有包(或指定解决方案).umar@umar-Lenovo-ideapad-320-15ISK:~/Desktop/portfolio/async-demo$sudo apt-get install -y mongodb
我相信他们的网站上已经提到了这背后的原因,明确地说
<块引用>平台支持
MongoDB 只提供 64 位 LTS 的包(长期支持)Ubuntu 发布;例如,14.04 LTS(可信)和 16.04 LTS(谢恩).如需了解详情,请参阅支持的平台.
这些软件包可能适用于其他 Ubuntu 版本;然而,他们是不支持.
那么如何在我最新的 Ubuntu 18.04 LTS 上安装 mongodb?为了清楚起见,我列出了我为纠正错误所做的事情:我是跟着他们官网安装mongodb的
<代码>1.sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D42. echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" |须藤三通/etc/apt/sources.list.d/mongodb-org-4.0.list3. sudo apt-get 更新4. sudo apt-get install -y mongodb-org
<块引用>
现在我收到错误提示:您可能想要运行 'apt --fix-broken安装'来纠正这些.以下软件包未满足依赖:
我试过了,
apt --fix-broken install
它没有用,我有线索可以运行
sudo apt -f install
它也返回了错误.
<块引用>处理时遇到错误:/var/cache/apt/archives/mongodb-org-server_4.0.0_amd64.deb/var/cache/apt/archives/mongodb-org-mongos_4.0.0_amd64.deb/var/cache/apt/archives/mongodb-org-tools_4.0.0_amd64.deb E:子进程/usr/bin/dpkg返回错误码(1)
我认为主要问题是与版本的兼容性.所以基本上我有 Ubuntu 18.04,我如何在这个版本上安装 mongodb,这样我就可以毫无问题地工作.
需要先卸载mongodb,可以使用:
sudo apt-get purge mongodb-org*
之后,通过以下命令安装mongodb:
sudo apt-get install mongodb
然后更新:
sudo apt-get 更新
您已经完成了 mongodb 的安装.您可以使用以下命令进行检查:
mongo --version
I am trying to install mongodb on my Ubuntu 18.04 LTS, but it has the following error saying
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 Depends: mongodb-org-tools but it is not going to be installed E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution). umar@umar-Lenovo-ideapad-320-15ISK:~/Desktop/portfolio/async-demo$ sudo apt-get install -y mongodb
I beleieve the reason behind this is already mentioned on their website, clearly saying
PLATFORM SUPPORT
MongoDB only provides packages for 64-bit LTS (long-term support) Ubuntu releases; for example, 14.04 LTS (trusty) and 16.04 LTS (xenial). See Supported Platforms for more information.
These packages may work with other Ubuntu releases; however, they are not supported.
So how can I install mongodb on my latest Ubuntu 18.04 LTS? For sake of clarity, I am listing the things I did to correct the errors: I followed their official website to install mongodb
1. sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
2. echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
3. sudo apt-get update
4. sudo apt-get install -y mongodb-org
Now here I got errors saying: You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies:
I tried,
apt --fix-broken install
It did not work, somewhere I got clue to run
sudo apt -f install
It also returned error.
Errors were encountered while processing: /var/cache/apt/archives/mongodb-org-server_4.0.0_amd64.deb /var/cache/apt/archives/mongodb-org-mongos_4.0.0_amd64.deb /var/cache/apt/archives/mongodb-org-tools_4.0.0_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)
I believe the main problem is compatability with version. So basically I have Ubuntu 18.04, how I install mongodb on this version, so that I can work without any trouble.
You need to first uninstall the mongodb, you can use:
sudo apt-get purge mongodb-org*
After this, install mongodb through the following commands:
sudo apt-get install mongodb
And then update:
sudo apt-get update
You are done with the installation of mongodb. You can check it by using the below command:
mongo --version
这篇关于无法在 ubuntu 18.04 LTS 上正确安装 mongodb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!