【发布时间】:2021-08-20 12:08:50
【问题描述】:
我已尝试按照the mongodb.com instructions 的说明安装 mongodb。
当我运行:sudo apt-get install -y mongodb-org 时,我得到以下信息:
The following packages have unmet dependencies.
mongodb-org-tools : Depends: mongodb-database-tools but it is not going to be installed
建议运行apt --fix-broken install。所以我用sudo 运行它。我得到以下信息:
The following packages were automatically installed and are no longer required:
libboost-program-options1.65.1 libgoogle-perftools4 libpcrecpp0v5 libtcmalloc-minimal4 libyaml-cpp0.5v5 mongo-tools
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
mongodb-database-tools
然后失败,并报告此错误:
Unpacking mongodb-database-tools (100.5.0) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-database-tools_100.5.0_amd64.deb (--unpack):
trying to overwrite '/usr/bin/bsondump', which is also in package mongo-tools 3.6.3-0ubuntu1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/mongodb-database-tools_100.5.0_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我对此的阅读:trying to overwrite '/usr/bin/bsondump', which is also in package mongo-tools 3.6.3-0ubuntu1 向我暗示mongo-tools 中有一些东西顽固地不让自己被删除。所以我尝试运行sudo apt autoremove 来删除mongo-tools。不幸的是,我得到以下信息:
The following packages have unmet dependencies.
mongodb-org-tools : Depends: mongodb-database-tools but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
所以我按照建议再次尝试apt --fix-broken install,但没有任何成功。我需要找到一种方法来摆脱该死的mongo-tools - 但是如何?我尝试按照上面链接的同一页面上的“卸载 MongoDB 社区版”说明进行操作。
当我输入 sudo apt-get purge mongodb-org* 时,这构成了消息的一部分:
The following packages were automatically installed and are no longer required:
libboost-program-options1.65.1 libgoogle-perftools4 libpcrecpp0v5 libtcmalloc-minimal4 libyaml-cpp0.5v5 mongo-tools mongodb-mongosh
Use 'sudo apt autoremove' to remove them.
所以现在我有mongo-tools 和这个新的mongodb-mongosh?我试图再次安装,但我遇到了同样的问题。解决方法是什么?
【问题讨论】:
标签: node.js linux mongodb ubuntu