PDA

View Full Version : 14.04 package problem with Unifi prevents any package install / upgrade



rdpierce
April 15th, 2018, 04:04 PM
I'm having a problem with dependencies using a third party package, "unifi", for Ubiquiti wireless access point management. At this point, I'm incapable of either reinstalling or uninstalling unifi due to a dependency issue with Java, and I can't install or upgrade any package on the system now. The dependency issue with unifi must have been introduced in the past few months, because before that time, it worked.

Context: The GUI package installer locked up and failed, and I had to close it. I could successfully "apt-get update". Then:


# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
E: Unmet dependencies. Try using -f.

So I try that:


# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
libbonobo2-0 libbonobo2-common libgnome2-0 libgnome2-bin libgraphicsmagick3
libquvi-scripts libquvi7 libxine1 libxine1-bin libxine1-ffmpeg
libxine1-misc-plugins libxine1-plugins linux-headers-3.13.0-123
linux-headers-3.13.0-123-generic linux-headers-3.13.0-128
linux-headers-3.13.0-128-generic linux-image-3.13.0-123-generic
linux-image-3.13.0-128-generic linux-image-3.2.0-126-generic
linux-image-extra-3.13.0-123-generic linux-image-extra-3.13.0-128-generic
mencoder
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 113 not upgraded.
1 not fully installed or removed.
E: Can't find a source to download version '5.6.29-10253' of 'unifi:amd64'

At this point, I try to remove unifi but can't:


# apt-get remove unifi
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
jsvc libbonobo2-0 libbonobo2-common libboost-filesystem1.54.0
libboost-program-options1.54.0 libboost-thread1.54.0 libcommons-daemon-java
libgnome2-0 libgnome2-bin libgoogle-perftools4 libgraphicsmagick3
libpcrecpp0 libquvi-scripts libquvi7 libsnappy1 libtcmalloc-minimal4
libunwind8 libv8-3.14.5 libxine1 libxine1-bin libxine1-ffmpeg
libxine1-misc-plugins libxine1-plugins linux-headers-3.13.0-123
linux-headers-3.13.0-123-generic linux-headers-3.13.0-128
linux-headers-3.13.0-128-generic linux-image-3.13.0-123-generic
linux-image-3.13.0-128-generic linux-image-3.2.0-126-generic
linux-image-extra-3.13.0-123-generic linux-image-extra-3.13.0-128-generic
mencoder mongodb-clients mongodb-server
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
unifi
0 upgraded, 0 newly installed, 1 to remove and 113 not upgraded.
1 not fully installed or removed.
After this operation, 96.8 MB disk space will be freed.
Do you want to continue? [Y/n]
dpkg: error processing package unifi (--remove):
package is in a very bad inconsistent state; you should
reinstall it before attempting a removal
E: Sub-process /usr/bin/dpkg returned an error code (1)

So I try to install / reinstall it:


# apt-get install --reinstall unifi
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
unifi : Depends: java8-runtime-headless but it is not installable
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Now I see the problem. Checking google, java8-runtime-headless doesn't work with 14.04. I know unifi is a third-party package, and fixing it isn't an Ubuntu issue. But with this package in an incompletely installed state, I can't go forward with the install or even remove it, and that means I can't install or upgrade any other packages.

Any help would be greatly appreciated.

TheFu
April 15th, 2018, 07:02 PM
Welcome to the forums.

A few thoughts:

a) Not that it helps with this issue, but for a single device install, there is an Android app. I manage a Ubiquiti AP for a friend using only the Android app.

b) Can you load a 16.04 install into a virtual machine? Will that let this be loaded?

What does the Ubiquiti forums suggest as the solution for 14.04 controllers?

rdpierce
April 21st, 2018, 05:55 PM
Thanks!

I posted to the Ubiquiti forums to see if I could get an answer over there. At this point, I have other options to manage my AP, so I'm not as concerned about whether I can get this package to work. I'm more concerned about whether there's a way to force an uninstall regardless of dependencies, because everything I've tried has failed, and I now can't apply any other package updates to this system.

TheFu
April 22nd, 2018, 07:01 PM
Anytime a package is installed that came from outside the Canonical repos or from a well-maintained PPA, there is a risk that dependency problems will arise. Usually it takes 3-6 months for the issues to begin. It starts by packages refusing to upgrade, then continues into what you have. I call it "rpm hell" because that was the first time I had issues like this - when running Redhat in the 1990s. "APT-hell" is the same, just for Debian-based distros, like Ubuntu.

Java is one of the packages that has issues more than others. This is because there are more than 1 version maintained from different teams and different java programs that each need of those different java packages. There's the Oracle versions. There's the openjdk versions. Within each of those are the different API levels. It gets confusing.

The way to fix this issues is to unroll the dependencies in the reverse order they were manually installed. Along the way, fix other dependency/upgrade issues. If you cannot unroll, it will get nasty. Chances are high that you'll break the system and end-up with a system that cannot be patched or worse, can't be booted. Most package commands have a --force option. Generally, if you use that, it breaks things. Expect problems, but if you are already stuck, there isn't much to loose.

Be certain you have backups before going to far.

Obviously, running some manually installed packages is very necessary, but beware that each of them has dependencies which have to be manually handled. Any manually installed .deb file, will likely lock Canonical package dependencies that you'd rather NOT have locked. That's the downside.

The fix is to, whenever possible, stay with Canonical versions of the tools. It works, IME. I haven't needed to wipe a system in almost 10 yrs because of that discipline. But I'm pretty close with 1 system.