1

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 http://ppa.launchpad.net/ondrej/apache2/ubuntu bionic InRelease
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]
Hit:3 http://pl.archive.ubuntu.com/ubuntu bionic InRelease
Get:4 http://pl.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:5 http://pl.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:6 http://pl.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [322 kB]
Get:7 http://pl.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages [286 kB]
Get:8 http://pl.archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages [192 kB]
Get:9 http://pl.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [192 kB]
Get:10 http://pl.archive.ubuntu.com/ubuntu bionic-updates/multiverse i386 Packages [4,360 B]
Get:11 http://pl.archive.ubuntu.com/ubuntu 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.

  • 1
    Try to run sudo apt update first to update the reopistory database on your machine. And, if the problem don't go away run sudo apt --fix-broken install as the output suggest. – Soren A Sep 14 '18 at 13:26
  • Doesnt help. I always do that. Unifi blocks it because it requires 3.4 mongodb. I have workaround this for installing manually but i want machine up to date – MadBoy Sep 14 '18 at 13:28
  • "Skipping" a set of packages can be done several ways: Apt-pinning, apt-marking, using snaps instead of debs, and manual install instead of deb. – user535733 Sep 14 '18 at 13:35
  • This is for single package. I want to exclude this from apt update, apt upgrade process. – MadBoy Sep 14 '18 at 13:42
  • Are you asking whether it is possible to get Apt to stop complaining about the unmet dependencies? That's a no; unmet dependencies are a big problem and should be fixed immediately. – fkraiem Sep 14 '18 at 13:48
5

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

Full story here: https://evotec.xyz/ubuntu-18-04-fixing-unifi-deb-package-to-run-with-3-6-mongodb/

But the idea is download package, unpack package

cd /home/username
wget https://dl.ubnt.com/unifi/5.9.29/unifi_sysvinit_all.deb
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 <unifi-dev@ubnt.com>
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: http://www.ubnt.com/unifi

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!

| improve this answer | |
2

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 http://repo.mongodb.org/apt/ubuntu 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
| improve this answer | |
  • But that also means I loose Unifi and need to reinstall it right? – MadBoy Sep 14 '18 at 15:09
  • @MadBoy I am not 100% sure on that one. It might not since it is looking for older than 3.6 on the version. – Terrance Sep 14 '18 at 15:09
  • @MadBoy If the repository provides 3.4, then installing the appropriate 3.4 packages will solve the dependency problem with no need to remove unifi. You will need to remove your current 3.6 packages, however (or force a downgrade). – fkraiem Sep 14 '18 at 15:12
  • @MadBoy You will also need to blacklist the 3.6 packages from the Ubuntu repos. – fkraiem Sep 14 '18 at 15:15
  • Ok, I guess I have to do it sooner or later. I guess other workaround would be to modify Unifi package and remove dependencies. Not sure how hard is it. Because that's what causing it. – MadBoy Sep 14 '18 at 15:15
1

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.

| improve this answer | |
  • I've opted for fixing Unifi package :-) Thanks for this thou as it told me to stop searching for workaround on apt level. – MadBoy Oct 5 '18 at 10:12

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.