由于保留了损坏的软件包,无法安装 Mongo

由于保留了损坏的软件包,无法安装 Mongo

如果我尝试在 Ubuntu 14.04 上安装 mongo:

sudo apt-get install -y mongodb-org

我收到错误:

Reading package lists... Done
Building dependency tree       
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 : Depends: mongodb-org-shell but it is not going to be installed
               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: Unable to correct problems, you have held broken packages.

这个类似的问题建议运行apt-mark showhold以查找被保留的包裹并解除保留,但它没有显示任何被保留的内容。

什么原因导致了此错误?我该如何修复它?

我正在从 Mongo 的 PPA 安装 Mongo。我之前已为 3.0 和 3.4 版本启用了 PPA。我删除了 3.0 版本的文件/etc/apt/sources.list.d/mongodb-org-3.0.list,以避免冲突,但我认为可能仍存在一些问题。

答案1

我遇到了同样的问题,问题是没有安装 libcurl3。这应该可以工作。

sudo apt install libcurl3

答案2

一开始并不是很明显,但当我去的时候回到文档,我意识到我安装了错误 Ubuntu 版本的 PPA。删除该 PPA 并安装正确的版本即可修复错误。

相关内容