The following packages have unmet dependencies:unifi

I've installed Unifi on fairly unsupported machine:

root@EvoWebsites:/home/pklys# apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: unifi : Depends: mongodb-server (< 1:3.6.0) but 1:3.6.3-0ubuntu1 is 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: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution). 

Now while I am able to manage ugprades of Unifi (the dependency is not really strick on it) I am unable to use apt upgrade anymore for the remaining packages.

Is there a way to "skip" unifi and it's dependency upgrades since I already do manual upgrades of Unifi and tell apt upgrade everything else ignoring what Unifi is saying?

What I've tried:

 root@EvoWebsites:/home/pklys# apt-mark hold unifi unifi was already set on hold. root@EvoWebsites:/home/pklys# apt update Hit:1 bionic InRelease Get:2 bionic-security InRelease [83.2 kB] Hit:3 bionic InRelease Get:4 bionic-updates InRelease [88.7 kB] Get:5 bionic-backports InRelease [74.6 kB] Get:6 bionic-updates/main amd64 Packages [322 kB] Get:7 bionic-updates/main i386 Packages [286 kB] Get:8 bionic-updates/universe i386 Packages [192 kB] Get:9 bionic-updates/universe amd64 Packages [192 kB] Get:10 bionic-updates/multiverse i386 Packages [4,360 B] Get:11 bionic-updates/multiverse amd64 Packages [4,200 B] Fetched 1,247 kB in 1s (2,426 kB/s) Reading package lists... Done Building dependency tree Reading state information... Done 98 packages can be upgraded. Run 'apt list --upgradable' to see them. root@EvoWebsites:/home/pklys# apt upgrade Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: unifi : Depends: mongodb-server (< 1:3.6.0) but 1:3.6.3-0ubuntu1 is 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: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution). 

To clarify. The end goal is to upgrade everything except for UNIFI and if it's not possible MongoDB. Ubiquiti with it's newest upgrade added dependency on UNIFI to mongodb 3.4. If you upgrade just like I did to 18.04 you get 3.6 which breaks Unifi. To fix it, I've uninstalled Unifi, reinstalled Unifi and brought the configuration from backup and it works fine on 3.6+ mongodb. My guess is that Ubiquiti doesn't have this process automated for the remaining users so for stable release they added this dependency.

Now since I'm already upgraded I need to keep my machine up to date. So now I need to skip Unifi upgrades (i install them from dpkg directly with skip dependencies), but keep upgrading other stuff.

Hope it explains both the reasons and the end goal.

11

3 Answers

While all good answers I've opted for different approach. Why fix Ubuntu while I can fix Unifi package!

Full story here:

But the idea is download package, unpack package

cd /home/username wget mkdir tmp dpkg-deb -R unifi_sysvinit_all.deb tmp 

Find DEBIAN\control file and simply remove 7-8th line from Depends section.

Package: unifi Version: 5.9.29-11384-1 Section: java Priority: optional Architecture: all Depends: binutils, coreutils, adduser, libcap2, curl, mongodb-server (>= 2.4.10) | mongodb-10gen (>= 2.4.14) | mongodb-org-server (>= 2.6.0), mongodb-server (<< 1:3.6.0) | mongodb-10gen (<< 3.6.0) | mongodb-org-server (<< 3.6.0), java8-runtime-headless, jsvc (>=1.0.8) Pre-Depends: debconf (>= 0.5) | debconf-2.0 Conflicts: unifi-controller Provides: unifi-controller Replaces: unifi-controller Installed-Size: 143115 Maintainer: UniFi developers <> Description: Ubiquiti UniFi server Ubiquiti UniFi server is a centralized management system for UniFi suite of devices. After the UniFi server is installed, the UniFi controller can be accessed on any web browser. The UniFi controller allows the operator to instantly provision thousands of UniFi devices, map out network topology, quickly manage system traffic, and further provision individual UniFi devices. Homepage: 

After that repackage:

dpkg-deb -b temporary unifi-fixed.deb dpkg-deb: building package 'unifi' in 'unifi-fixed.deb'. 

And simply install dpkg -i unifi-fixed.deb. After installation apt update, apt upgrade works!

For MongoDB 3.4 try the following.

First remove any list files for MongoDB

sudo rm /etc/apt/sources.list.d/mongodb* 

Next, add the key

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv A15703C6 

Now add the repository for 3.4

sudo bash -c 'echo "deb xenial/mongodb-org/3.4 multiverse" > /etc/apt/sources.list.d/mongodb-org-3.4.list' 

Now run the updates and upgrade

sudo apt update sudo apt upgrade 
9

You have a package (unifi) with unmet dependencies. The Apt packaging system considers unmet dependencies to be a big problem and will keep complaining about it until it is solved. There is no other way to stop it.

To solve it, you must either install the missing dependencies or remove unifi.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like