web-dev-qa-db-fra.com

Impossible de réinstaller MongoDB sur Ubuntu 17

J'ai désinstallé avant MongoDB mais je ne peux plus l'installer à cause de l'erreur suivante:

dpkg-deb: error: subprocess paste was killed by signal (Broken pipe).

J'ai lancé cette commande -> Sudo apt-get install -y mongodb-org

La sortie de mon terminal est la suivante:

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libboost-chrono1.62.0 libboost-program-options1.62.0 libgoogle-perftools4
libtcmalloc-minimal4 libunwind8 libyaml-cpp0.5v5 linux-headers-4.13.0-16
linux-headers-4.13.0-16-generic linux-headers-4.13.0-21
linux-headers-4.13.0-21-generic linux-image-4.13.0-16-generic
linux-image-4.13.0-21-generic linux-image-extra-4.13.0-16-generic
linux-image-extra-4.13.0-21-generic linux-signed-image-4.13.0-16-generic
linux-signed-image-4.13.0-21-generic mongo-tools
Use 'Sudo apt autoremove' to remove them.
The following additional packages will be installed:
mongodb-org-mongos mongodb-org-server mongodb-org-Shell mongodb-org-tools
The following NEW packages will be installed:
mongodb-org mongodb-org-mongos mongodb-org-server mongodb-org-Shell
mongodb-org-tools
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/66.8 MB of archives.
After this operation, 276 MB of additional disk space will be used.
Selecting previously unselected package mongodb-org-Shell.
(Reading database ... 316734 files and directories currently installed.)
Preparing to unpack .../mongodb-org-Shell_3.6.2_AMD64.deb ...
Unpacking mongodb-org-Shell (3.6.2) ...
Selecting previously unselected package mongodb-org-server.
Preparing to unpack .../mongodb-org-server_3.6.2_AMD64.deb ...
Unpacking mongodb-org-server (3.6.2) ...
Selecting previously unselected package mongodb-org-mongos.
Preparing to unpack .../mongodb-org-mongos_3.6.2_AMD64.deb ...
Unpacking mongodb-org-mongos (3.6.2) ...
Preparing to unpack .../mongodb-org-tools_3.6.2_AMD64.deb ...
Unpacking mongodb-org-tools (3.6.2) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-tools_3.6.2_AMD64.deb (--unpack):
trying to overwrite '/usr/bin/bsondump', which is also in package mongo-tools 3.2.11-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Selecting previously unselected package mongodb-org.
Preparing to unpack .../mongodb-org_3.6.2_AMD64.deb ...
Unpacking mongodb-org (3.6.2) ...
Errors were encountered while processing:
/var/cache/apt/archives/mongodb-org-tools_3.6.2_AMD64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Après avoir exécuté apt --fix-broken install, le résultat est le suivant:

apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  libboost-chrono1.62.0 libboost-program-options1.62.0 libgoogle-perftools4 libtcmalloc-minimal4 libunwind8 libyaml-cpp0.5v5 linux-headers-4.13.0-16
  linux-headers-4.13.0-16-generic linux-headers-4.13.0-21 linux-headers-4.13.0-21-generic linux-image-4.13.0-16-generic
  linux-image-4.13.0-21-generic linux-image-extra-4.13.0-16-generic linux-image-extra-4.13.0-21-generic linux-signed-image-4.13.0-16-generic
  linux-signed-image-4.13.0-21-generic mongo-tools
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  mongodb-org-tools
The following NEW packages will be installed:
  mongodb-org-tools
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
Need to get 0 B/34.9 MB of archives.
After this operation, 150 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 316761 files and directories currently installed.)
Preparing to unpack .../mongodb-org-tools_3.6.2_AMD64.deb ...
Unpacking mongodb-org-tools (3.6.2) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-tools_3.6.2_AMD64.deb (--unpack):
 trying to overwrite '/usr/bin/bsondump', which is also in package mongo-tools 3.2.11-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/mongodb-org-tools_3.6.2_AMD64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
5
ganeshdeshmukh

Vous pouvez forcer l'installation du package:

Sudo dpkg -i --force-all /var/cache/apt/archives/mongodb-org-tools_3.6.2_AMD64.deb

Puis reprenez avec:

Sudo apt-get install -f
6
N0rbert