MongoDB installation failed on Ubuntu 16.04





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







10















I followed instructions given on the official MongoDB website (https://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/) and I get this error when trying to install MongoDB. How to fix this issue and what's going wrong? Remember I'm using latest Ubuntu version 16.04



sudo apt-get install -y mongodb-org

Reading package lists... Done

Building dependency tree

Reading state information... Done

You might want to run 'apt-get -f install' to correct these:

The following packages have unmet dependencies:

mongodb-org :

Depends: mongodb-org-shell but it is not going to be installed

Depends: mongodb-org-server but it is not going to be installed

Depends: mongodb-org-mongos but it is not going to be installed

Depends: mongodb-org-tools but it is not going to be installed

virtualbox-5.0 : Depends: libqt4-opengl (>= 4:4.7.2) but it is not going to be installed

Depends: libsdl1.2debian (>= 1.2.11) but it is not going to be installed

Recommends: libsdl-ttf2.0-0 but it is not going to be installed

E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).


Edit: Title. MongDB -> MongoDB.










share|improve this question

























  • I tried running the install instructions posted by t9toqwerty / muru. But still got the message the following packages have unmet dependencies: What worked for me was to manually install MongoDB from the tarball: docs.mongodb.com/manual/tutorial/install-mongodb-on-linux

    – Josh B'Gosh
    Aug 24 '17 at 21:00











  • Which mongodb version are you trying to install?

    – Elouan Keryell-Even
    Feb 8 '18 at 12:28


















10















I followed instructions given on the official MongoDB website (https://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/) and I get this error when trying to install MongoDB. How to fix this issue and what's going wrong? Remember I'm using latest Ubuntu version 16.04



sudo apt-get install -y mongodb-org

Reading package lists... Done

Building dependency tree

Reading state information... Done

You might want to run 'apt-get -f install' to correct these:

The following packages have unmet dependencies:

mongodb-org :

Depends: mongodb-org-shell but it is not going to be installed

Depends: mongodb-org-server but it is not going to be installed

Depends: mongodb-org-mongos but it is not going to be installed

Depends: mongodb-org-tools but it is not going to be installed

virtualbox-5.0 : Depends: libqt4-opengl (>= 4:4.7.2) but it is not going to be installed

Depends: libsdl1.2debian (>= 1.2.11) but it is not going to be installed

Recommends: libsdl-ttf2.0-0 but it is not going to be installed

E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).


Edit: Title. MongDB -> MongoDB.










share|improve this question

























  • I tried running the install instructions posted by t9toqwerty / muru. But still got the message the following packages have unmet dependencies: What worked for me was to manually install MongoDB from the tarball: docs.mongodb.com/manual/tutorial/install-mongodb-on-linux

    – Josh B'Gosh
    Aug 24 '17 at 21:00











  • Which mongodb version are you trying to install?

    – Elouan Keryell-Even
    Feb 8 '18 at 12:28














10












10








10


3






I followed instructions given on the official MongoDB website (https://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/) and I get this error when trying to install MongoDB. How to fix this issue and what's going wrong? Remember I'm using latest Ubuntu version 16.04



sudo apt-get install -y mongodb-org

Reading package lists... Done

Building dependency tree

Reading state information... Done

You might want to run 'apt-get -f install' to correct these:

The following packages have unmet dependencies:

mongodb-org :

Depends: mongodb-org-shell but it is not going to be installed

Depends: mongodb-org-server but it is not going to be installed

Depends: mongodb-org-mongos but it is not going to be installed

Depends: mongodb-org-tools but it is not going to be installed

virtualbox-5.0 : Depends: libqt4-opengl (>= 4:4.7.2) but it is not going to be installed

Depends: libsdl1.2debian (>= 1.2.11) but it is not going to be installed

Recommends: libsdl-ttf2.0-0 but it is not going to be installed

E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).


Edit: Title. MongDB -> MongoDB.










share|improve this question
















I followed instructions given on the official MongoDB website (https://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/) and I get this error when trying to install MongoDB. How to fix this issue and what's going wrong? Remember I'm using latest Ubuntu version 16.04



sudo apt-get install -y mongodb-org

Reading package lists... Done

Building dependency tree

Reading state information... Done

You might want to run 'apt-get -f install' to correct these:

The following packages have unmet dependencies:

mongodb-org :

Depends: mongodb-org-shell but it is not going to be installed

Depends: mongodb-org-server but it is not going to be installed

Depends: mongodb-org-mongos but it is not going to be installed

Depends: mongodb-org-tools but it is not going to be installed

virtualbox-5.0 : Depends: libqt4-opengl (>= 4:4.7.2) but it is not going to be installed

Depends: libsdl1.2debian (>= 1.2.11) but it is not going to be installed

Recommends: libsdl-ttf2.0-0 but it is not going to be installed

E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).


Edit: Title. MongDB -> MongoDB.







apt 16.04 mongodb






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 16 '17 at 10:48







ssudaraka

















asked May 5 '16 at 10:47









ssudarakassudaraka

53117




53117













  • I tried running the install instructions posted by t9toqwerty / muru. But still got the message the following packages have unmet dependencies: What worked for me was to manually install MongoDB from the tarball: docs.mongodb.com/manual/tutorial/install-mongodb-on-linux

    – Josh B'Gosh
    Aug 24 '17 at 21:00











  • Which mongodb version are you trying to install?

    – Elouan Keryell-Even
    Feb 8 '18 at 12:28



















  • I tried running the install instructions posted by t9toqwerty / muru. But still got the message the following packages have unmet dependencies: What worked for me was to manually install MongoDB from the tarball: docs.mongodb.com/manual/tutorial/install-mongodb-on-linux

    – Josh B'Gosh
    Aug 24 '17 at 21:00











  • Which mongodb version are you trying to install?

    – Elouan Keryell-Even
    Feb 8 '18 at 12:28

















I tried running the install instructions posted by t9toqwerty / muru. But still got the message the following packages have unmet dependencies: What worked for me was to manually install MongoDB from the tarball: docs.mongodb.com/manual/tutorial/install-mongodb-on-linux

– Josh B'Gosh
Aug 24 '17 at 21:00





I tried running the install instructions posted by t9toqwerty / muru. But still got the message the following packages have unmet dependencies: What worked for me was to manually install MongoDB from the tarball: docs.mongodb.com/manual/tutorial/install-mongodb-on-linux

– Josh B'Gosh
Aug 24 '17 at 21:00













Which mongodb version are you trying to install?

– Elouan Keryell-Even
Feb 8 '18 at 12:28





Which mongodb version are you trying to install?

– Elouan Keryell-Even
Feb 8 '18 at 12:28










6 Answers
6






active

oldest

votes


















4














Install mongodb in Ubuntu 12.04, 14.04 ,16.04





  1. Import the public key used by the package management system



    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5



  2. Create a list file for MongoDB.



    In Ubuntu 12.04 (deprecated):



    echo "deb http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list


    In Ubuntu 14.04:



    echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list


    In Ubuntu 16.04:



    echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list



  3. Reload local package database.



    sudo apt-get update


    It will throw a warning



    W: http://repo.mongodb.org/apt/ubuntu/dists/trusty/mongodb-org/3.0/Release.gpg: Signature by key 492EAFE8CD016A07919F1D2B9ECBEC467F0CEB10 uses weak digest algorithm (SHA1)


    Just Ignore It.




  4. Install the MongoDB packages.



    sudo apt-get install -y mongodb-org



After installation you can start MongoDB using



sudo service mongod start


To stop MongoDB use



sudo service mongod stop


To restart MongoDB use



sudo service mongod restart


If that didn't work, check here to see if any of the steps have been updated: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/






share|improve this answer





















  • 3





    you are not using latest mongo 3.4 as referenced in OP mongo link

    – Scott Stensland
    Jan 9 '17 at 19:32





















3














TL;DR;



Try running this command,



sudo apt-get install libcurl3 openssl


and then



sudo apt-get install mongodb-org


Logs:



So I've followed official instructions on Mongo 4.0 here and got this after running sudo apt-get install mongodb-org



The following packages have unmet dependencies:
mongodb-org : Depends: mongodb-org-server but it is not going to be installed
E: Unable to correct problems, you have held broken packages.


Then I manually added mongodb-org-server to installation command:



sudo apt-get install mongodb-org mongo-db-server


but then I got



mongodb-org-server : Depends: libcurl3 (>= 7.16.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.


After manually installing these:



sudo apt-get install libcurl3 openssl


I got it working with single:



sudo apt-get install mongodb-org


command.






share|improve this answer


























  • @Arman glad that I could help )

    – naffiq
    Dec 3 '18 at 10:56



















1














I tried running the install instructions posted by t9toqwerty / muru. But still got the message



the following packages have unmet dependencies:


What worked for me was to manually install MongoDB from the tarball. Original link is: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-linux/



1) Download Binaries



curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.9.tgz


2) Extract Files



tar -zxvf mongodb-linux-x86_64-3.4.9.tgz


3) Copy Archive to Target Directory



mkdir -p mongodb
cp -R -n mongodb-linux-x86_64-3.4.9/ mongodb


4) Place location in the PATH variable.



export PATH=<mongodb-install-directory>/bin:$PATH


(Replace <mongodb-install-directory> with the path to the extracted MongoDB archive. For me this was /home/myusername/mongodb/mongodb-linux-x86_64-3.4.9)



Next comes running it:



1) Create Data Directory



mkdir -p /data/db


2) Set Permissions



This is making sure the user has read and write permissions for the directory. Find the directory in the terminal, and enter



chmod 777 /data/db


3) Run it!



mongod


If you didn't set up the PATH variable in step 4, run mongo by entering the path to your bin file— like so



<path to binary>/mongod





share|improve this answer































    0














    Xenial (Ubuntu 16.04); MongoDB v. 3.2.11



    apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
    echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.2.list
    apt-get -qq update (if you are using docker)
    apt-get update
    apt-get install mongodb-org


    I just did it and it was fine.



    Font: https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04






    share|improve this answer


























    • I guess the OP is trying to install mongodb 3.6 since I had same issues when installing that version. So installing version 3.2 might not be an acceptable solution.

      – Elouan Keryell-Even
      Feb 8 '18 at 14:42



















    0














    First, remove all mongo packages.




    1. List all mongo packages.


    sudo apt list --installed | grep 'mongo'




    1. Remove package.


    sudo apt-get purge --auto-remove packagename




    1. Then follow the mongo installation documentation.


    https://docs.mongodb.com/manual/tutorial/install-mongodb-on-linux/






    share|improve this answer































      0














      I faced the same couple of days back. Try running through aptitude. This will take care of installing all the dependency packages.



      sudo apt-get install aptitude
      sudo aptitude install mongodb-org





      share|improve this answer
























        Your Answer








        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "89"
        };
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function() {
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled) {
        StackExchange.using("snippets", function() {
        createEditor();
        });
        }
        else {
        createEditor();
        }
        });

        function createEditor() {
        StackExchange.prepareEditor({
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader: {
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        },
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f767934%2fmongodb-installation-failed-on-ubuntu-16-04%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        6 Answers
        6






        active

        oldest

        votes








        6 Answers
        6






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        4














        Install mongodb in Ubuntu 12.04, 14.04 ,16.04





        1. Import the public key used by the package management system



          sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5



        2. Create a list file for MongoDB.



          In Ubuntu 12.04 (deprecated):



          echo "deb http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list


          In Ubuntu 14.04:



          echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list


          In Ubuntu 16.04:



          echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list



        3. Reload local package database.



          sudo apt-get update


          It will throw a warning



          W: http://repo.mongodb.org/apt/ubuntu/dists/trusty/mongodb-org/3.0/Release.gpg: Signature by key 492EAFE8CD016A07919F1D2B9ECBEC467F0CEB10 uses weak digest algorithm (SHA1)


          Just Ignore It.




        4. Install the MongoDB packages.



          sudo apt-get install -y mongodb-org



        After installation you can start MongoDB using



        sudo service mongod start


        To stop MongoDB use



        sudo service mongod stop


        To restart MongoDB use



        sudo service mongod restart


        If that didn't work, check here to see if any of the steps have been updated: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/






        share|improve this answer





















        • 3





          you are not using latest mongo 3.4 as referenced in OP mongo link

          – Scott Stensland
          Jan 9 '17 at 19:32


















        4














        Install mongodb in Ubuntu 12.04, 14.04 ,16.04





        1. Import the public key used by the package management system



          sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5



        2. Create a list file for MongoDB.



          In Ubuntu 12.04 (deprecated):



          echo "deb http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list


          In Ubuntu 14.04:



          echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list


          In Ubuntu 16.04:



          echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list



        3. Reload local package database.



          sudo apt-get update


          It will throw a warning



          W: http://repo.mongodb.org/apt/ubuntu/dists/trusty/mongodb-org/3.0/Release.gpg: Signature by key 492EAFE8CD016A07919F1D2B9ECBEC467F0CEB10 uses weak digest algorithm (SHA1)


          Just Ignore It.




        4. Install the MongoDB packages.



          sudo apt-get install -y mongodb-org



        After installation you can start MongoDB using



        sudo service mongod start


        To stop MongoDB use



        sudo service mongod stop


        To restart MongoDB use



        sudo service mongod restart


        If that didn't work, check here to see if any of the steps have been updated: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/






        share|improve this answer





















        • 3





          you are not using latest mongo 3.4 as referenced in OP mongo link

          – Scott Stensland
          Jan 9 '17 at 19:32
















        4












        4








        4







        Install mongodb in Ubuntu 12.04, 14.04 ,16.04





        1. Import the public key used by the package management system



          sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5



        2. Create a list file for MongoDB.



          In Ubuntu 12.04 (deprecated):



          echo "deb http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list


          In Ubuntu 14.04:



          echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list


          In Ubuntu 16.04:



          echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list



        3. Reload local package database.



          sudo apt-get update


          It will throw a warning



          W: http://repo.mongodb.org/apt/ubuntu/dists/trusty/mongodb-org/3.0/Release.gpg: Signature by key 492EAFE8CD016A07919F1D2B9ECBEC467F0CEB10 uses weak digest algorithm (SHA1)


          Just Ignore It.




        4. Install the MongoDB packages.



          sudo apt-get install -y mongodb-org



        After installation you can start MongoDB using



        sudo service mongod start


        To stop MongoDB use



        sudo service mongod stop


        To restart MongoDB use



        sudo service mongod restart


        If that didn't work, check here to see if any of the steps have been updated: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/






        share|improve this answer















        Install mongodb in Ubuntu 12.04, 14.04 ,16.04





        1. Import the public key used by the package management system



          sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5



        2. Create a list file for MongoDB.



          In Ubuntu 12.04 (deprecated):



          echo "deb http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list


          In Ubuntu 14.04:



          echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list


          In Ubuntu 16.04:



          echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list



        3. Reload local package database.



          sudo apt-get update


          It will throw a warning



          W: http://repo.mongodb.org/apt/ubuntu/dists/trusty/mongodb-org/3.0/Release.gpg: Signature by key 492EAFE8CD016A07919F1D2B9ECBEC467F0CEB10 uses weak digest algorithm (SHA1)


          Just Ignore It.




        4. Install the MongoDB packages.



          sudo apt-get install -y mongodb-org



        After installation you can start MongoDB using



        sudo service mongod start


        To stop MongoDB use



        sudo service mongod stop


        To restart MongoDB use



        sudo service mongod restart


        If that didn't work, check here to see if any of the steps have been updated: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Feb 3 '18 at 21:20









        karel

        61.3k13133155




        61.3k13133155










        answered May 5 '16 at 12:07









        t9toqwertyt9toqwerty

        8931816




        8931816








        • 3





          you are not using latest mongo 3.4 as referenced in OP mongo link

          – Scott Stensland
          Jan 9 '17 at 19:32
















        • 3





          you are not using latest mongo 3.4 as referenced in OP mongo link

          – Scott Stensland
          Jan 9 '17 at 19:32










        3




        3





        you are not using latest mongo 3.4 as referenced in OP mongo link

        – Scott Stensland
        Jan 9 '17 at 19:32







        you are not using latest mongo 3.4 as referenced in OP mongo link

        – Scott Stensland
        Jan 9 '17 at 19:32















        3














        TL;DR;



        Try running this command,



        sudo apt-get install libcurl3 openssl


        and then



        sudo apt-get install mongodb-org


        Logs:



        So I've followed official instructions on Mongo 4.0 here and got this after running sudo apt-get install mongodb-org



        The following packages have unmet dependencies:
        mongodb-org : Depends: mongodb-org-server but it is not going to be installed
        E: Unable to correct problems, you have held broken packages.


        Then I manually added mongodb-org-server to installation command:



        sudo apt-get install mongodb-org mongo-db-server


        but then I got



        mongodb-org-server : Depends: libcurl3 (>= 7.16.2) but it is not going to be installed
        E: Unable to correct problems, you have held broken packages.


        After manually installing these:



        sudo apt-get install libcurl3 openssl


        I got it working with single:



        sudo apt-get install mongodb-org


        command.






        share|improve this answer


























        • @Arman glad that I could help )

          – naffiq
          Dec 3 '18 at 10:56
















        3














        TL;DR;



        Try running this command,



        sudo apt-get install libcurl3 openssl


        and then



        sudo apt-get install mongodb-org


        Logs:



        So I've followed official instructions on Mongo 4.0 here and got this after running sudo apt-get install mongodb-org



        The following packages have unmet dependencies:
        mongodb-org : Depends: mongodb-org-server but it is not going to be installed
        E: Unable to correct problems, you have held broken packages.


        Then I manually added mongodb-org-server to installation command:



        sudo apt-get install mongodb-org mongo-db-server


        but then I got



        mongodb-org-server : Depends: libcurl3 (>= 7.16.2) but it is not going to be installed
        E: Unable to correct problems, you have held broken packages.


        After manually installing these:



        sudo apt-get install libcurl3 openssl


        I got it working with single:



        sudo apt-get install mongodb-org


        command.






        share|improve this answer


























        • @Arman glad that I could help )

          – naffiq
          Dec 3 '18 at 10:56














        3












        3








        3







        TL;DR;



        Try running this command,



        sudo apt-get install libcurl3 openssl


        and then



        sudo apt-get install mongodb-org


        Logs:



        So I've followed official instructions on Mongo 4.0 here and got this after running sudo apt-get install mongodb-org



        The following packages have unmet dependencies:
        mongodb-org : Depends: mongodb-org-server but it is not going to be installed
        E: Unable to correct problems, you have held broken packages.


        Then I manually added mongodb-org-server to installation command:



        sudo apt-get install mongodb-org mongo-db-server


        but then I got



        mongodb-org-server : Depends: libcurl3 (>= 7.16.2) but it is not going to be installed
        E: Unable to correct problems, you have held broken packages.


        After manually installing these:



        sudo apt-get install libcurl3 openssl


        I got it working with single:



        sudo apt-get install mongodb-org


        command.






        share|improve this answer















        TL;DR;



        Try running this command,



        sudo apt-get install libcurl3 openssl


        and then



        sudo apt-get install mongodb-org


        Logs:



        So I've followed official instructions on Mongo 4.0 here and got this after running sudo apt-get install mongodb-org



        The following packages have unmet dependencies:
        mongodb-org : Depends: mongodb-org-server but it is not going to be installed
        E: Unable to correct problems, you have held broken packages.


        Then I manually added mongodb-org-server to installation command:



        sudo apt-get install mongodb-org mongo-db-server


        but then I got



        mongodb-org-server : Depends: libcurl3 (>= 7.16.2) but it is not going to be installed
        E: Unable to correct problems, you have held broken packages.


        After manually installing these:



        sudo apt-get install libcurl3 openssl


        I got it working with single:



        sudo apt-get install mongodb-org


        command.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jul 2 '18 at 14:13









        Stephen Rauch

        1,1566716




        1,1566716










        answered Jul 2 '18 at 13:16









        naffiqnaffiq

        1312




        1312













        • @Arman glad that I could help )

          – naffiq
          Dec 3 '18 at 10:56



















        • @Arman glad that I could help )

          – naffiq
          Dec 3 '18 at 10:56

















        @Arman glad that I could help )

        – naffiq
        Dec 3 '18 at 10:56





        @Arman glad that I could help )

        – naffiq
        Dec 3 '18 at 10:56











        1














        I tried running the install instructions posted by t9toqwerty / muru. But still got the message



        the following packages have unmet dependencies:


        What worked for me was to manually install MongoDB from the tarball. Original link is: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-linux/



        1) Download Binaries



        curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.9.tgz


        2) Extract Files



        tar -zxvf mongodb-linux-x86_64-3.4.9.tgz


        3) Copy Archive to Target Directory



        mkdir -p mongodb
        cp -R -n mongodb-linux-x86_64-3.4.9/ mongodb


        4) Place location in the PATH variable.



        export PATH=<mongodb-install-directory>/bin:$PATH


        (Replace <mongodb-install-directory> with the path to the extracted MongoDB archive. For me this was /home/myusername/mongodb/mongodb-linux-x86_64-3.4.9)



        Next comes running it:



        1) Create Data Directory



        mkdir -p /data/db


        2) Set Permissions



        This is making sure the user has read and write permissions for the directory. Find the directory in the terminal, and enter



        chmod 777 /data/db


        3) Run it!



        mongod


        If you didn't set up the PATH variable in step 4, run mongo by entering the path to your bin file— like so



        <path to binary>/mongod





        share|improve this answer




























          1














          I tried running the install instructions posted by t9toqwerty / muru. But still got the message



          the following packages have unmet dependencies:


          What worked for me was to manually install MongoDB from the tarball. Original link is: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-linux/



          1) Download Binaries



          curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.9.tgz


          2) Extract Files



          tar -zxvf mongodb-linux-x86_64-3.4.9.tgz


          3) Copy Archive to Target Directory



          mkdir -p mongodb
          cp -R -n mongodb-linux-x86_64-3.4.9/ mongodb


          4) Place location in the PATH variable.



          export PATH=<mongodb-install-directory>/bin:$PATH


          (Replace <mongodb-install-directory> with the path to the extracted MongoDB archive. For me this was /home/myusername/mongodb/mongodb-linux-x86_64-3.4.9)



          Next comes running it:



          1) Create Data Directory



          mkdir -p /data/db


          2) Set Permissions



          This is making sure the user has read and write permissions for the directory. Find the directory in the terminal, and enter



          chmod 777 /data/db


          3) Run it!



          mongod


          If you didn't set up the PATH variable in step 4, run mongo by entering the path to your bin file— like so



          <path to binary>/mongod





          share|improve this answer


























            1












            1








            1







            I tried running the install instructions posted by t9toqwerty / muru. But still got the message



            the following packages have unmet dependencies:


            What worked for me was to manually install MongoDB from the tarball. Original link is: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-linux/



            1) Download Binaries



            curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.9.tgz


            2) Extract Files



            tar -zxvf mongodb-linux-x86_64-3.4.9.tgz


            3) Copy Archive to Target Directory



            mkdir -p mongodb
            cp -R -n mongodb-linux-x86_64-3.4.9/ mongodb


            4) Place location in the PATH variable.



            export PATH=<mongodb-install-directory>/bin:$PATH


            (Replace <mongodb-install-directory> with the path to the extracted MongoDB archive. For me this was /home/myusername/mongodb/mongodb-linux-x86_64-3.4.9)



            Next comes running it:



            1) Create Data Directory



            mkdir -p /data/db


            2) Set Permissions



            This is making sure the user has read and write permissions for the directory. Find the directory in the terminal, and enter



            chmod 777 /data/db


            3) Run it!



            mongod


            If you didn't set up the PATH variable in step 4, run mongo by entering the path to your bin file— like so



            <path to binary>/mongod





            share|improve this answer













            I tried running the install instructions posted by t9toqwerty / muru. But still got the message



            the following packages have unmet dependencies:


            What worked for me was to manually install MongoDB from the tarball. Original link is: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-linux/



            1) Download Binaries



            curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.9.tgz


            2) Extract Files



            tar -zxvf mongodb-linux-x86_64-3.4.9.tgz


            3) Copy Archive to Target Directory



            mkdir -p mongodb
            cp -R -n mongodb-linux-x86_64-3.4.9/ mongodb


            4) Place location in the PATH variable.



            export PATH=<mongodb-install-directory>/bin:$PATH


            (Replace <mongodb-install-directory> with the path to the extracted MongoDB archive. For me this was /home/myusername/mongodb/mongodb-linux-x86_64-3.4.9)



            Next comes running it:



            1) Create Data Directory



            mkdir -p /data/db


            2) Set Permissions



            This is making sure the user has read and write permissions for the directory. Find the directory in the terminal, and enter



            chmod 777 /data/db


            3) Run it!



            mongod


            If you didn't set up the PATH variable in step 4, run mongo by entering the path to your bin file— like so



            <path to binary>/mongod






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Oct 12 '17 at 22:01









            Josh B'GoshJosh B'Gosh

            112




            112























                0














                Xenial (Ubuntu 16.04); MongoDB v. 3.2.11



                apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
                echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.2.list
                apt-get -qq update (if you are using docker)
                apt-get update
                apt-get install mongodb-org


                I just did it and it was fine.



                Font: https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04






                share|improve this answer


























                • I guess the OP is trying to install mongodb 3.6 since I had same issues when installing that version. So installing version 3.2 might not be an acceptable solution.

                  – Elouan Keryell-Even
                  Feb 8 '18 at 14:42
















                0














                Xenial (Ubuntu 16.04); MongoDB v. 3.2.11



                apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
                echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.2.list
                apt-get -qq update (if you are using docker)
                apt-get update
                apt-get install mongodb-org


                I just did it and it was fine.



                Font: https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04






                share|improve this answer


























                • I guess the OP is trying to install mongodb 3.6 since I had same issues when installing that version. So installing version 3.2 might not be an acceptable solution.

                  – Elouan Keryell-Even
                  Feb 8 '18 at 14:42














                0












                0








                0







                Xenial (Ubuntu 16.04); MongoDB v. 3.2.11



                apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
                echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.2.list
                apt-get -qq update (if you are using docker)
                apt-get update
                apt-get install mongodb-org


                I just did it and it was fine.



                Font: https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04






                share|improve this answer















                Xenial (Ubuntu 16.04); MongoDB v. 3.2.11



                apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
                echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.2.list
                apt-get -qq update (if you are using docker)
                apt-get update
                apt-get install mongodb-org


                I just did it and it was fine.



                Font: https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Dec 24 '16 at 18:21









                George Udosen

                21.9k104673




                21.9k104673










                answered Dec 24 '16 at 17:16









                MarcosMarcos

                1012




                1012













                • I guess the OP is trying to install mongodb 3.6 since I had same issues when installing that version. So installing version 3.2 might not be an acceptable solution.

                  – Elouan Keryell-Even
                  Feb 8 '18 at 14:42



















                • I guess the OP is trying to install mongodb 3.6 since I had same issues when installing that version. So installing version 3.2 might not be an acceptable solution.

                  – Elouan Keryell-Even
                  Feb 8 '18 at 14:42

















                I guess the OP is trying to install mongodb 3.6 since I had same issues when installing that version. So installing version 3.2 might not be an acceptable solution.

                – Elouan Keryell-Even
                Feb 8 '18 at 14:42





                I guess the OP is trying to install mongodb 3.6 since I had same issues when installing that version. So installing version 3.2 might not be an acceptable solution.

                – Elouan Keryell-Even
                Feb 8 '18 at 14:42











                0














                First, remove all mongo packages.




                1. List all mongo packages.


                sudo apt list --installed | grep 'mongo'




                1. Remove package.


                sudo apt-get purge --auto-remove packagename




                1. Then follow the mongo installation documentation.


                https://docs.mongodb.com/manual/tutorial/install-mongodb-on-linux/






                share|improve this answer




























                  0














                  First, remove all mongo packages.




                  1. List all mongo packages.


                  sudo apt list --installed | grep 'mongo'




                  1. Remove package.


                  sudo apt-get purge --auto-remove packagename




                  1. Then follow the mongo installation documentation.


                  https://docs.mongodb.com/manual/tutorial/install-mongodb-on-linux/






                  share|improve this answer


























                    0












                    0








                    0







                    First, remove all mongo packages.




                    1. List all mongo packages.


                    sudo apt list --installed | grep 'mongo'




                    1. Remove package.


                    sudo apt-get purge --auto-remove packagename




                    1. Then follow the mongo installation documentation.


                    https://docs.mongodb.com/manual/tutorial/install-mongodb-on-linux/






                    share|improve this answer













                    First, remove all mongo packages.




                    1. List all mongo packages.


                    sudo apt list --installed | grep 'mongo'




                    1. Remove package.


                    sudo apt-get purge --auto-remove packagename




                    1. Then follow the mongo installation documentation.


                    https://docs.mongodb.com/manual/tutorial/install-mongodb-on-linux/







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 4 '18 at 10:31









                    Girish SharmaGirish Sharma

                    1




                    1























                        0














                        I faced the same couple of days back. Try running through aptitude. This will take care of installing all the dependency packages.



                        sudo apt-get install aptitude
                        sudo aptitude install mongodb-org





                        share|improve this answer




























                          0














                          I faced the same couple of days back. Try running through aptitude. This will take care of installing all the dependency packages.



                          sudo apt-get install aptitude
                          sudo aptitude install mongodb-org





                          share|improve this answer


























                            0












                            0








                            0







                            I faced the same couple of days back. Try running through aptitude. This will take care of installing all the dependency packages.



                            sudo apt-get install aptitude
                            sudo aptitude install mongodb-org





                            share|improve this answer













                            I faced the same couple of days back. Try running through aptitude. This will take care of installing all the dependency packages.



                            sudo apt-get install aptitude
                            sudo aptitude install mongodb-org






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Apr 3 at 11:20









                            MythiliMythili

                            1




                            1






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Ask Ubuntu!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f767934%2fmongodb-installation-failed-on-ubuntu-16-04%23new-answer', 'question_page');
                                }
                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                數位音樂下載

                                When can things happen in Etherscan, such as the picture below?

                                格利澤436b