Unable to install mongodb properly on ubuntu 18.04 LTS

前端 未结 14 1284
盖世英雄少女心
盖世英雄少女心 2021-02-03 23:26

I am trying to install mongodb on my Ubuntu 18.04 LTS, but it has the following error saying

You might want to run \'apt --fix-broken install\' to correct

14条回答
  •  有刺的猬
    2021-02-03 23:51

    For Ubuntu version 18.04 LTS, it's better if you will install MongoDB manually.

    I need to go through the following steps to make it run on my Ubuntu 18.04:

    1. Fallow manual installation steps from the following mongo DB manual https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu-tarball/
    2. Download .tgz with the following configurations Download MongoDB
    3. Please note, when you install MongoDB 3.6 or above, it comes up with Curl library of "libcurl4" version and which has some compatibility issues on ubuntu 18.04
    4. Due to this, you will end up resulting following output when try to execute "mongod" command:

    mongod: /usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by mongod)

    1. To fix this problem, you need to uninstall "libcurl4" dependent library by using the following command

      sudo apt-get remove libcurl4

    2. Then need to install back lower curl lib version (i.e. "libcurl3"), as mongo expects it on ubuntu version "18.04"

      sudo apt-get install libcurl3

    3. You may need to use "sudo" to fork the data and log directories with the installation if it fails with the manual steps

      sudo mongod --dbpath /var/lib/mongo --logpath /var/log/mongodb/mongod.log --fork

    4. you can run "mongo" command now to see the mongo shell running.

    It works for me.

提交回复
热议问题