安装 mongodb 后,软件包对 18.04 的依赖项未满足

Cai*_*ero 21 package-management apt dpkg dependencies mongodb

所以,我尝试在我的本地机器 Ubuntu 18.04 上安装 mongo。

安装因错误而停止

The following packages have unmet dependencies:
mongodb-org : Depends: mongodb-org-server but it is not installed
              Depends: mongodb-org-mongos but it is not installed
              Depends: mongodb-org-tools but it is not installed
Run Code Online (Sandbox Code Playgroud)

[编辑] 我没有安装的原始错误。但是,如果你们中有人需要任何帮助,请告诉我

我试着跑'apt --fix-broken install',它给了我

(Reading database ... 207088 files and directories currently installed.)
Preparing to unpack .../mongodb-org-server_3.6.6_amd64.deb ...
Unpacking mongodb-org-server (3.6.6) ...
**dpkg**: error processing archive /var/cache/apt/archives/mongodb-org-server_3.6.6_amd64.deb (--unpack):
trying to overwrite '/usr/bin/mongod', which is also in package mongodb-server-core 1:3.6.3-0ubuntu1
**dpkg-deb**: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-org-mongos_3.6.6_amd64.deb ...
Unpacking mongodb-org-mongos (3.6.6) ...
**dpkg**: error processing archive /var/cache/apt/archives/mongodb-org-mongos_3.6.6_amd64.deb (--unpack):
trying to overwrite '/usr/bin/mongos', which is also in package mongodb-server-core 1:3.6.3-0ubuntu1
**dpkg-deb**: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-org-tools_3.6.6_amd64.deb ...
Unpacking mongodb-org-tools (3.6.6) ...
**dpkg**: error processing archive /var/cache/apt/archives/mongodb-org-tools_3.6.6_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_3.6.6_amd64.deb
/var/cache/apt/archives/mongodb-org-mongos_3.6.6_amd64.deb
/var/cache/apt/archives/mongodb-org-tools_3.6.6_amd64.deb
Run Code Online (Sandbox Code Playgroud)

然后我尝试'apt-get install -f',它返回与--fix-broken. 尝试purge mongodb,尝试删除存储库,编辑源列表以使用 16.04,尝试过apt remove,尝试过apt autoremove

我的选择不多了。谁能帮我?

[编辑]

来源清单如下:

# deb cdrom:[Ubuntu 17.10 _Artful Aardvark_ - Release amd64 (20180105.1)]/ artful main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://br.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://br.archive.ubuntu.com/ubuntu/ artful main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://br.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://br.archive.ubuntu.com/ubuntu/ artful-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://br.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://br.archive.ubuntu.com/ubuntu/ artful universe
deb http://br.archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://br.archive.ubuntu.com/ubuntu/ artful-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://br.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://br.archive.ubuntu.com/ubuntu/ artful multiverse
deb http://br.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
# deb-src http://br.archive.ubuntu.com/ubuntu/ artful-updates multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu artful partner
# deb-src http://archive.canonical.com/ubuntu artful partner

deb http://security.ubuntu.com/ubuntu bionic-security main restricted
# deb-src http://security.ubuntu.com/ubuntu artful-security main restricted
deb http://security.ubuntu.com/ubuntu bionic-security universe
# deb-src http://security.ubuntu.com/ubuntu artful-security universe
deb http://security.ubuntu.com/ubuntu bionic-security multiverse
# deb-src http://security.ubuntu.com/ubuntu artful-security multiverse
deb http://archive.ubuntu.com/ubuntu bionic universe
# deb-src http://archive.ubuntu.com/ubuntu artful universe
deb http://repository.spotify.com stable non-free
# deb-src http://repository.spotify.com stable non-free
# deb-src http://repository.spotify.com stable non-free
Run Code Online (Sandbox Code Playgroud)

[编辑2]

试过sudo apt-get purge mongodb mongodb-server mongodb-server-core mongodb-clients,它返回这个

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'mongodb' is not installed, so not removed
Package 'mongodb-clients' is not installed, so not removed
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).
Run Code Online (Sandbox Code Playgroud)

Ber*_*Wei 51

从日志中,看起来您已经从 Ubuntu 18.04 安装了 mongodb,然后您修改了 repo 以从 mongodb 添加一个。在从 mongodb 存储库安装一个之前,先尝试从 Ubuntu 存储库中删除 mongodb。

Ubuntu 附带 mongodb 版本 3.6.3,并且已经安装。先将其删除。

sudo apt-get purge mongodb mongodb-server mongodb-server-core mongodb-clients
sudo apt-get purge mongodb-org
sudo apt-get autoremove
Run Code Online (Sandbox Code Playgroud)

然后再次尝试安装

sudo apt-get update
sudo apt-get install mongodb-org
Run Code Online (Sandbox Code Playgroud)

已编辑,问题清除...

尝试分别强行删除两个有问题的包。

sudo dpkg --remove --force-remove-reinstreq mongo-tools
sudo dpkg --remove --force-remove-reinstreq mongodb-server-core
Run Code Online (Sandbox Code Playgroud)

之后你可以再次这样做,

sudo apt-get --fix-broken install
Run Code Online (Sandbox Code Playgroud)

  • +1 强行删除 (5认同)
  • 添加了强制删除两个违规软件包的步骤。 (2认同)

Cai*_*ero 6

我使用了apt remove mongodb-org,它成功清除了损坏的依赖项并立即恢复正常

谢谢大家