Reading package lists... Done
Building dependency tree
Reading state information... Done
mongodb-org is already the newest version (4.4.5).
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
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).
Asked
Active
Viewed 8,670 times
1

Marc Vanhoomissen
- 2,204
1 Answers
4
start with removing all PPA repositories for mongodb, then:
sudo apt-get purge mongodb-org*
sudo apt remove mongodb
sudo apt purge mongodb
sudo apt autoremove
sudo rm -r /var/log/mongodb
sudo rm -r /var/lib/mongodb
sudo apt-get install gnupg
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
sudo apt-get update
sudo apt-get upgrade
sudo apt update
sudo apt upgrade
sudo apt-get install -y mongodb-org
sudo apt-get install libc6
sudo service mongod start
sudo service mongod status
This helped me with the issue.
This solution was taken from here.

Scientist
- 114
-
I just tried it but im still having the same error – cordelia adik Jun 08 '22 at 14:00
-
This worked for me, And after that, ensure you have given the correct ownership to the directories. See this: https://askubuntu.com/questions/823288/mongodb-loads-but-breaks-returning-status-14 – Disapamok Oct 18 '22 at 09:14
-
This solution worked for me. Though sudo apt upgrade really took a long time – chobela Mar 20 '23 at 10:00