That's why I've chosen a bit different approach. Why fix Ubuntu, while I can fix Unifi package! And it's actually quite simple...
💡 Steps to fix Unifi package
- 💡 Download new Unifi package
- 💡 Pack .deb package again
And that's it! Easier said then done you say... well here it is... a simple step by step.
cd /home/username
mkdir tmp
cd tmp
wget https://dl.ubnt.com/unifi/5.9.29/unifi_sysvinit_all.deb
mkdir temporary
dpkg-deb -R unifi_sysvinit_all.deb temporary
Now edit control file which should be in unpacked directory inside DEBIAN folder. It's content will look like this. I've marked the lines that needs removing
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: http://www.ubnt.com/unifi
After removing those 2 lines you must repackage unifi.deb.
root@EvoWebsites:/home/pklys/tmp# dpkg-deb -b temporary unifi-fixed.deb
dpkg-deb: building package 'unifi' in 'unifi-fixed.deb'.
Now all that is left is try if the Unifi package actually installs over currently installed one!
root@EvoWebsites:/home/pklys/tmp# dpkg -i unifi-fixed.deb
(Reading database ... 135659 files and directories currently installed.)
Preparing to unpack unifi-fixed.deb ...
Previous setting (UniFi 5.9.29) is found.
Unpacking unifi (5.9.29-11384-1) over (5.9.29-11384-1) ...
Setting up unifi (5.9.29-11384-1) ...
Processing triggers for systemd (237-3ubuntu10) ...
Processing triggers for ureadahead (0.100.0-20) ...
root@EvoWebsites:/home/pklys/tmp#
After that... simply rerun apt update, apt-upgrade and it will work!
root@EvoWebsites:/home/pklys/tmp# apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
linux-headers-4.15.0-36 linux-headers-4.15.0-36-generic linux-image-4.15.0-36-generic linux-modules-4.15.0-36-generic linux-modules-extra-4.15.0-36-generic
The following packages will be upgraded:
amd64-microcode apache2 apache2-bin apache2-data apache2-utils apparmor apport apt apt-transport-https apt-utils base-files bind9-host binutils binutils-common
binutils-x86-64-linux-gnu ca-certificates-java console-setup console-setup-linux cpp cpp-7 curl dnsutils gcc gcc-7 gcc-7-base gcc-8-base grub-common grub-pc
grub-pc-bin grub2-common initramfs-tools initramfs-tools-bin initramfs-tools-core intel-microcode keyboard-configuration libapparmor-perl libapparmor1
libapt-inst2.0 libapt-pkg5.0 libasan4 libatomic1 libavahi-client3 libavahi-common-data libavahi-common3 libbind9-160 libbinutils libbrotli1 libcc1-0 libcilkrts5
libcryptsetup12 libcurl3-gnutls libcurl4 libdns-export1100 libdns1100 libegl1 libgcc-7-dev libgcc1 libgd3 libgl1 libglib2.0-0 libglib2.0-data libglvnd0 libglx0
libgomp1 libgpgme11 libirs160 libisc-export169 libisc169 libisccc160 libisccfg160 libitm1 liblcms2-2 liblsan0 liblwres160 libmpx2 libnss-systemd libpam-systemd
libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libperl5.26 libplymouth4 libpolkit-agent-1-0 libpolkit-backend-1-0 libpolkit-gobject-1-0 libpython3-stdlib
libpython3.6 libpython3.6-minimal libpython3.6-stdlib libquadmath0 libstdc++6 libsystemd0 libtsan0 libubsan0 libudev1 libx11-6 libx11-data libx11-dev libx11-doc
libx11-xcb1 libxml2 linux-generic linux-headers-generic linux-image-generic linux-libc-dev lshw mutt mysql-client-5.7 mysql-client-core-5.7 mysql-server
mysql-server-5.7 mysql-server-core-5.7 netplan.io nplan openjdk-11-jre-headless openjdk-8-jdk openjdk-8-jdk-headless openjdk-8-jre openjdk-8-jre-headless perl
perl-base perl-modules-5.26 php7.2 php7.2-bz2 php7.2-cli php7.2-common php7.2-curl php7.2-fpm php7.2-gd php7.2-json php7.2-mbstring php7.2-mysql php7.2-opcache
php7.2-readline php7.2-xml php7.2-xmlrpc plymouth plymouth-theme-ubuntu-text policykit-1 python-apt python-apt-common python-cryptography python3 python3-apport
python3-apt python3-cryptography python3-distupgrade python3-minimal python3-problem-report python3-software-properties python3-update-manager python3.6
python3.6-minimal rkhunter screen snapd software-properties-common squashfs-tools systemd systemd-sysv tzdata ubuntu-release-upgrader-core udev
unattended-upgrades update-manager-core wpasupplicant x11-common
167 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 243 MB of archives.
After this operation, 337 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Since this is a process that has to be repeated over and over again, I decided to write a short PowerShell module that fixes it each time for you. There's another blog post about it. I know you may not like PowerShell being installed on Linux but it works just fine, and it's something I'm skilled at. Easy to use, works on all platforms. What's not to love?
And we're done. Unifi 5.9.29 on Ubuntu 18.04 with MongoDB higher then 3.4 version and no complains from APT!