Unable to install mongodb properly on ubuntu 18.04 LTS

前端 未结 14 1474
盖世英雄少女心
盖世英雄少女心 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-04 00:06

    This is because as of now Mongo DB for Ubuntu 18.04 is only available as a development version (See: MongoDB Distros).

    I just installed it by doing the following:

    Add the corresponding signature:

        sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4B7C549A058F8B6B  
    

    Add the supported version:

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

    Update:

        sudo apt update
    

    Install:

    sudo apt install mongodb-org-unstable
    

    If you get a "GPG error" repeat step 1 with the key that is shown in the error message. You might be able to install via

    sudo apt install mongodb
    

    but according to MongoDB this is not supported and will most probably not install the newest version.

提交回复
热议问题