I tried to install mongoDB in my OS so I followed these steps:
1- “wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -”
output
pub rsa4096 2021-02-16 [SC] [expires: 2026-02-15]
F567 9A22 2C64 7C87 527C 2F8C B00A 0BD1 E2C6 3C11
uid [ unknown] MongoDB 5.0 Release Signing Key <packaging@mongodb.com>
2- “echo “deb MongoDB Repositories buster/mongodb-org/5.0 main” | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list”
output:
deb http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0 main
3- after sudo apt-get update:
“sudo apt install mongodb-org”
output:
Reading package lists... Done
Building dependency tree
Reading state information... Done
mongodb-org is already the newest version (5.0.2).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
mongodb-org-database : Depends: mongodb-org-server but it is not going to be installed
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).
4- “sudo apt --fix-broken install”
output:
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-program-options1.71.0 libgoogle-perftools4 libpcrecpp0v5 libtcmalloc-minimal4 libyaml-cpp0.6 mongo-tools mongodb-server-core
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
mongodb-database-tools mongodb-org-mongos mongodb-org-server
The following NEW packages will be installed:
mongodb-database-tools mongodb-org-mongos mongodb-org-server
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
Need to get 0 B/91.1 MB of archives.
After this operation, 182 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 294599 files and directories currently installed.)
Preparing to unpack .../mongodb-org-server_5.0.2_amd64.deb ...
Unpacking mongodb-org-server (5.0.2) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-server_5.0.2_amd64.deb (--unpack):
trying to overwrite '/usr/bin/mongod', which is also in package mongodb-server-core 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-org-mongos_5.0.2_amd64.deb ...
Unpacking mongodb-org-mongos (5.0.2) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-mongos_5.0.2_amd64.deb (--unpack):
trying to overwrite '/usr/bin/mongos', which is also in package mongodb-server-core 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-database-tools_100.5.0_amd64.deb ...
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-org-server_5.0.2_amd64.deb
/var/cache/apt/archives/mongodb-org-mongos_5.0.2_amd64.deb
/var/cache/apt/archives/mongodb-database-tools_100.5.0_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Sorry for this long post, but I’m really stuck since 2 days and I didn’t find any solution, plz help me