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

Posted November 22, 2018 3.7k views
MongoDBUbuntu 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.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
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!