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).

1 Answer 1


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.

  • I just tried it but im still having the same error Commented Jun 8, 2022 at 14:00
  • This worked for me, And after that, ensure you have given the correct ownership to the directories. See this: askubuntu.com/questions/823288/…
    – Disapamok
    Commented Oct 18, 2022 at 9:14
  • This solution worked for me. Though sudo apt upgrade really took a long time
    – chobela
    Commented Mar 20, 2023 at 10:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .