Ubuntu – Dependency trouble when installing libcups2-dev

aptdependenciesdpkgpackage-management

I am running on ubuntu 16.04, upgraded from 15.10 (which may not be relevant). I cannot install libcups2-dev due to a dependency issue. I outline both the problem and the troubleshooting steps below:

My problem:

The following command to install libcups2-dev (for use with a dymo printer) is met with the following response:

~ % sudo apt-get install libcups2-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libcups2-dev : Depends: libcupsimage2-dev (= 2.2.0-2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Troubleshooting steps:

"Ah," says I. "I wonder what is held?"

~ % sudo dpkg --get-selections | grep hold
~ %

Nothing is held, or that command isn't valid anymore? Oh well. Let's go hunting. If libcups2-dev can't be installed because of libcupsimage2-dev, what's stopping libcupsimage2-dev?

I find out (output truncated a bit for brevity):

~ % sudo apt-get install libcupsimage2-dev

The following packages have unmet dependencies:
 libcupsimage2-dev : Depends: libtiff-dev
E: Unable to correct problems, you have held broken packages.

I then follow this line of questioning all the way down. libcupsimage2-dev depends on libtiff-dev, which depends on libjbig-dev, which depends on libjbig0… and here I find the problem:

~ % sudo apt-get install libjbig-dev

The following packages have unmet dependencies:
 libjbig-dev : Depends: libjbig0 (= 2.1-3.1) but 2.1-3.1+deb.sury.org~xenial+1 is to be installed
E: Unable to correct problems, you have held broken packages.

HOW CURIOUS. libjbig-dev requires libjbig0 2.1-3.1, which I HAVE, but the version I have has a bunch of… well, I don't know what all that +deb.sury.org goobery stuff is behind the version number. But you guys do, right?

Let's continue, for a moment. After the traditional apt-get update and apt-get upgrade…:

~ % sudo apt-get install libjbig0
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libjbig0 is already the newest version (2.1-3.1+deb.sury.org~xenial+1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

tl;dr

libcups2-dev is stopped because one of its grand-dependencies, libjbig-dev requires libjbig0 2.1-3.1. Only I HAVE that version of libjbig0, but it's not being recognized as the correct version. So… first, what's happening, and second, how can I correct it? Oh, and third, what is all that +deb.sury.org stuff?

Best Answer

Looks like the answer was more obvious than it needed to be.

I was right to think that the version 'mismatch' was the problem. I forced apt-get to install the 'other' 2.1-3.1 version of libjbig0:

~ % sudo apt-get install libjbig0=2.1-3.1

Which worked, but apt-get prompted me that this was a downgrade. Welp. Either way, this resolved the dependency issue and I was able to successfully install libcups2-dev.

I'd still love to know what all the +deb stuff as a suffix to the version number was, though, if any of you are bored.