【问题标题】:Unable to install or remove mongodb无法安装或删除 mongodb
【发布时间】:2020-12-06 08:36:43
【问题描述】:

我正在尝试使用(以 root 身份运行)安装 mongodb 4.4:apt install -y mongodb-org

然后我得到了

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 mongodb-org : 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).

所以我使用apt --fix-broken install 并得到:

(Reading database ... 72856 files and directories currently installed.)
Preparing to unpack .../mongodb-org-server_4.4.2_amd64.deb ...
Unpacking mongodb-org-server (4.4.2) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-server_4.4.2_amd64.deb (--unpack):
 trying to overwrite '/usr/bin/mongod', which is also in package mongodb-server-core 1:3.6.3-0ubuntu1.1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-org-mongos_4.4.2_amd64.deb ...
Unpacking mongodb-org-mongos (4.4.2) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-mongos_4.4.2_amd64.deb (--unpack):
 trying to overwrite '/usr/bin/mongos', which is also in package mongodb-server-core 1:3.6.3-0ubuntu1.1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-database-tools_100.2.1_amd64.deb ...
Unpacking mongodb-database-tools (100.2.1) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-database-tools_100.2.1_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-org-server_4.4.2_amd64.deb
 /var/cache/apt/archives/mongodb-org-mongos_4.4.2_amd64.deb
 /var/cache/apt/archives/mongodb-database-tools_100.2.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

所以我尝试使用:apt remove mongodb-org 删除 mongodb 并得到:

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 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).

【问题讨论】:

标签: mongodb ubuntu


【解决方案1】:

Mongodb is not updated properly from 4.2 to 4.4

删除所有已安装的 mongodb 包,然后安装 4.4 包。

使用dpkg -l |grep mongodb 查找您已安装的那些。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-09-15
    • 1970-01-01
    • 2014-10-02
    • 1970-01-01
    • 2012-06-21
    • 1970-01-01
    • 2018-12-23
    • 2022-06-29
    相关资源
    最近更新 更多