2

The problem:

# apt-get install libssl-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:
 libssl-dev : Depends: libssl1.0.0 (= 1.0.1t-1+deb8u6) but 1.0.2k-1~bpo8+1 is to be installed
              Recommends: libssl-doc but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

The research:

# apt-cache policy libssl-dev
libssl-dev:
  Installed: (none)
  Candidate: 1.0.1t-1+deb8u6
  Version table:
     1.0.2k-1~bpo8+1 0
        400 http://httpredir.debian.org/debian/ jessie-backports/main amd64 Packages
     1.0.1t-1+deb8u6 0
        900 http://security.debian.org/ jessie/updates/main amd64 Packages
     1.0.1t-1+deb8u5 0
        900 http://httpredir.debian.org/debian/ jessie/main amd64 Packages

100 <= P < 500 causes a version to be installed unless there is a version available belonging to some other distribution or the installed version is more recent

500 <= P < 990 causes a version to be installed unless there is a version available belonging to the target release or the installed version is more recent

Details:

# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 8.7 (jessie)
Release:    8.7
Codename:   jessie

# cat /etc/apt/preferences
Package: *
Pin: release a=stable
Pin-Priority: 900

Package: *
Pin: release a=jessie-backports
Pin-Priority: 400

It seems that my priorities are pinned correctly, notwithstanding apt-get is trying to install version from the jessie-backorts. Why?

EDIT

# apt-cache policy libssl1.0.0
libssl1.0.0:
  Installed: 1.0.2k-1~bpo8+1
  Candidate: 1.0.2k-1~bpo8+1
  Version table:
 *** 1.0.2k-1~bpo8+1 0
        100 /var/lib/dpkg/status
     1.0.1t-1+deb8u6 0
        990 http://security.debian.org/ jessie/updates/main amd64 Packages
     1.0.1t-1+deb8u5 0
        990 http://httpredir.debian.org/debian/ jessie/main amd64 Packages

I think I now understand what is the problem.

3

You shouldn’t ever pin a backports suite; by default it’s configured so that it’s only every used for installations with an explicit target, or for upgrades of a backported version. I recommend you remove your /etc/apt/preferences file entirely.

Anyway, your error is not related to pinning, but caused by the installed version of libssl1.0.0 from backports. Note the candidate version given by apt-cache policy libssl-dev: that shows that apt-get would prefer the stable version, not the backported version. The error message you’re getting is

The following packages have unmet dependencies:
 libssl-dev : Depends: libssl1.0.0 (= 1.0.1t-1+deb8u6) but 1.0.2k-1~bpo8+1 is to be installed
              Recommends: libssl-doc but it is not going to be installed

which shows that apt-get is trying to install libssl-dev 1.0.1t-1+deb8u6 (hence the dependency on libssl1.0.0 with the same version), but the version of libssl1.0.0 being considered is 1.0.2k-1~bpo8+1, because that’s what’s already installed...

  • Then what about stuff in the man page? stable has the same pkg (lower version, but the same pkg), hence backports must be ignored. – NarūnasK Apr 20 '17 at 11:59
  • See my updated answer (and ignore my first attempt, it was incorrect — the manpage is correct, but installed packages win). – Stephen Kitt Apr 20 '17 at 12:02
  • IMHO your statements regarding pinning backports are incorrect, but you were right about already installed package. – NarūnasK Apr 20 '17 at 12:09
  • Read the backports instructions: “All backports are deactivated by default (i.e. the packages are pinned to 100 by using ButAutomaticUpgrades: yes in the Release files.” – Stephen Kitt Apr 20 '17 at 12:18
  • Note that my pinned priority is 400, thus it's within the same range (100 <= P < 500) as backports preferred default 100. – NarūnasK Apr 20 '17 at 12:29

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.