`apt-get install librdkafka1` fails on Debian 9.x

2019-07-28 20:42发布

问题:

Basic apt-get install librdkafka1 works on Debian 8.x but fails on Debian 9.x. This looks like a dependency version issue regarding libssl. Debian 8.x had libssl1.0.0 and Debian 9.x has libssl1.0.2 and libssl1.1, but no libssl1.0.0 and this version bump just causes the librdkafka1 install to break.

This is easily reproducible on the latest official Docker Debian 9 image:

docker pull debian:9
docker run --rm -it debian:9

Then within the VM

cat /etc/debian_version
# 9.4

apt-get update
# Get basics to setup Confluent repository
apt-get install -y wget gnupg2 software-properties-common libssl1.0.2

wget -qO - http://packages.confluent.io/deb/4.1/archive.key | apt-key add -
add-apt-repository "deb [arch=amd64] http://packages.confluent.io/deb/4.1 stable main"
apt-get update

apt-cache policy libssl1.0.2 results in:

libssl1.0.2:
  Installed: 1.0.2l-2+deb9u3
  Candidate: 1.0.2l-2+deb9u3
  Version table:
 *** 1.0.2l-2+deb9u3 500
        500 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
        100 /var/lib/dpkg/status
     1.0.2l-2+deb9u2 500
        500 http://deb.debian.org/debian stretch/main amd64 Packages

apt-cache policy librdkafka1 results in:

librdkafka1:
  Installed: (none)
  Candidate: 0.11.4~1confluent4.1.0-1
  Version table:
     0.11.4~1confluent4.1.0-1 500
        500 http://packages.confluent.io/deb/4.1 stable/main amd64 Packages
     0.9.3-1 500
        500 http://deb.debian.org/debian stretch/main amd64 Packages

And apt-get install librdkafka1 results in:

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:
 librdkafka1 : Depends: libssl1.0.0 (>= 1.0.0) but it is not installable
E: Unable to correct problems, you have held broken packages.

apt-cache search libssl produces the following. Note that there is a libssl1.0.2 and libssl1.1 but no libssl1.0.0

libssl-ocaml - OCaml bindings for OpenSSL (runtime)
libssl-ocaml-dev - OCaml bindings for OpenSSL
libssl-dev - Secure Sockets Layer toolkit - development files
libssl-doc - Secure Sockets Layer toolkit - development documentation
libssl1.1 - Secure Sockets Layer toolkit - shared libraries
libssl1.0-dev - Secure Sockets Layer toolkit - development files
libssl1.0.2 - Secure Sockets Layer toolkit - shared libraries

UPDATE: This issue is still present with Confluent 4.1, librdkafka 0.11.4 and Debian 9.4.

回答1:

librdkafka1 has been added to stretch-backports:

https://packages.debian.org/stretch-backports/librdkafka1

To install:

add-apt-repository "deb http://deb.debian.org/debian stretch-backports main contrib non-free"
apt-get update
apt-get install librdkafka1/stretch-backports

The version of librdkafka1 in the official Confluent repo doesn't support Debian 9. Confluent Platform itself doesn't officially support Debian 9 as of Confluent 5.0: https://docs.confluent.io/current/installation/system-requirements.html#system-requirements



回答2:

FYI, the primary librdkafka maintainer Edenhill answered this in a comment:

Confluent does not yet provide librdkafka packages for Debian 9, but will do so soon. I suggest you build librdkafka from source until then, or check the standard Debian packages (which will most likely have an older version of librdkafka though)

librdkafka simply doesn't support Debian 9. This is still true as of Confluent Platform 4.1. Debian 9 is still not officially supported by the Confluent Platform: https://docs.confluent.io/current/installation/installing_cp.html



回答3:

I think that you have an error in your apt sources.

As the logs say, the repository packages.confluent.io is getting used and propose a new version over Debian's repository.

You can check the list of dependency of a package with apt show python-kafka or from the cache with apt-cache show python-kafka

Did you dist-upgrade from Jessie to Stretch ?