DEV Community

Kazi Abdur Rakib
Kazi Abdur Rakib

Posted on

Try 'apt --fix-broken install' with no packages (or specify a solution).

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

It looks like you have unmet dependencies, and you're prompted to run 'apt --fix-broken install' to resolve them. Let's go through the steps to fix this:

  1. Run the following command to fix the broken dependencies:

    sudo apt --fix-broken install
    

This will attempt to correct any dependency issues.

  1. Once that is done, you can try installing curl and mongodb-org-server again:

    sudo apt-get install gnupg curl
    

    If there are still issues, you may need to update your package lists:

    sudo apt-get update
    

    And then try the installation again.

  2. If you encounter issues with the version of libcurl4 or libssl1.1, you may need to specify the versions explicitly in your installation command. For example:

    sudo apt-get install curl=7.81.0-1ubuntu1.14
    sudo apt-get install mongodb-org-server=<desired_version>
    

    Replace <desired_version> with the version you want to install.

  3. After resolving the dependencies, you can proceed with the MongoDB installation. Make sure to follow the instructions for your specific Linux distribution. For Ubuntu, you can refer to the MongoDB documentation:

    echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
    sudo apt-get update
    sudo apt-get install -y mongodb-org
    

Please note that package versions might have changed since my last training cut-off in January 2022, so adapt the commands accordingly based on the latest versions available in your package manager.

Top comments (0)