Unable to install mongodb properly on ubuntu 18.04 LTS

前端 未结 14 1252
盖世英雄少女心
盖世英雄少女心 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:53

    Uninstall and remove any Mongo packages.

    $ sudo apt-get purge mongodb-org*
    

    Check if related directories removed

    $ sudo rm -r /var/log/mongodb
    $ sudo rm -r /var/lib/mongodb
    

    Recheck for autoremove any remaining mongo packages

    $ sudo apt-get autoremove
    

    Configure your directory

    $ sudo dpkg --configure -a
    

    Force install anything required

    $ sudo apt-get install -f
    

    Install from official site: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/

    Finally restart your Ubuntu and check status of Mogodb server as you did earlier.

提交回复
热议问题