how can I install a previous version of mongodb-server? I have 1:3.6.3-0ubuntu1 currently

November 22, 2018 1.7k views
MongoDB Ubuntu 18.04

getting the following message (see below) when attempting to install some files they require version 1:3.4.x
I have 1:3.6.3-0ubuntu1 currently

The following packages have unmet dependencies:
unifi : Depends: mongodb-server (< 1:3.6.0) but 1:3.6.3-0ubuntu1 is to be installed or
mongodb-10gen (< 3.6.0) but it is not installable or
mongodb-org-server (< 3.6.0) but it is not installable
E: Unable to correct problems, you have held broken packages.

1 Answer

Where are you getting your unifi package from? It’s not in the official Ubuntu repositories. From what I can tell, UniFi does not have an official repository for Ubuntu 18.04; it has a repository for Debian 9, and recommends using this script for Ubuntu. Before you risk the security of your server, make sure that your repository is for Ubuntu 18.04 Bionic Beaver and not any other Linux distribution. That means the word bionic should be in the line you add to your sources.list to make the repository work.

If that isn’t helpful, then in order to downgrade with APT, look at all available versions with apt-cache showpkg <package>, then install the correct one with sudo apt install <package>=<version>. A fair warning: this will mean that the package you downgrade won’t ever be upgraded, which could leave your server insecure!

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!