![由于保留了损坏的软件包,无法安装 Mongo](https://linux22.com/image/1202972/%E7%94%B1%E4%BA%8E%E4%BF%9D%E7%95%99%E4%BA%86%E6%8D%9F%E5%9D%8F%E7%9A%84%E8%BD%AF%E4%BB%B6%E5%8C%85%EF%BC%8C%E6%97%A0%E6%B3%95%E5%AE%89%E8%A3%85%20Mongo.png)
如果我尝试在 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 并安装正确的版本即可修复错误。