Search code examples
linuxmongodb

getting Error while installing mongodb in linux


   The following packages have unmet dependencies:
 mongodb-org-mongos : Depends: libssl1.0.0 (>= 1.0.1) but it is not   installable
 mongodb-org-server : Depends: libssl1.0.0 (>= 1.0.1) but it is not installable
 mongodb-org-shell : Depends: libssl1.0.0 (>= 1.0.1) but it is not installable
 mongodb-org-tools : Depends: libssl1.0.0 (>= 1.0.1) but it is not installable
E: Unable to correct problems, you have held broken packages.

I am getting this error even i did update the repo : sudo apt-get update

also i did check if there any broken packeges with : sudo apt-get check

step i took to install mongodb in linux: 1) sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5

2) echo "deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.6 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list

3)sudo apt-get update

4)sudo apt-get install -y mongodb-org

but still getting the same error. how can i solve this?


Solution

  • In my case, I'm using Linux Mint 17 -> Ubuntu 14.04 and I was installing with Ubuntu 16.04 resulting in this conflict.

    Check your Ubuntu/Debian version - the wiki is a useful resource - before trying these commands.

    If that doesn't solve it then run

    sudo apt purge mongod* 
    sudo apt purge mongodb* 
    sudo apt purge mongodb-org* 
    

    That should remove any inconsistency and then go to https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ and follow the procedure.

    This resolved the issue.