首页 > Linux故障排查, Ubuntu/Debian操作系统 > Debian packages don’t follow Provides?

Debian packages don’t follow Provides?

2016年11月25日

Debian packages don’t follow Provides?

http://stackoverflow.com/questions/33467679/debian-packages-dont-follow-provides
I have the following 2 packages (custom built):

**apt-cache show libmysqlclient18**
Package: libmysqlclient18
Section: libs
Installed-Size: 4194
Architecture: amd64
Version: 5.6.27
Depends: mysql-common (>= 5.6.27)
Filename: ./libmysqlclient18.deb
Size: 1167158
MD5sum: cf4a5d292456375c4099b11f5ee6270d
SHA1: e9c4f185bed358e5dda908555686b2884d341772
SHA256: 3092f2af61493bd8e75503568ff622ce1dd81a9ce04aa072d28c336092835e8f
SHA512: e0ffcf7cd48f230225fb48bf5fee8968f1e4006c581529b196a27bff06257fe1da55e80434af0e2e58d2805156da37c44d7994a5af233e8942ecc6d99d680117
Description-en: MySQL database client library
MySQL is a fast, stable and true multi-user, multi-threaded SQL database
server. SQL (Structured Query Language) is the most popular database query
language in the world. The main goals of MySQL are speed, robustness and
ease of use.
.
This package includes the client library.
And the following:

**dpkg –info libmysqlclient20.deb**
new debian package, version 2.0.
size 1429220 bytes: control archive=909 bytes.
768 bytes, 18 lines control
72 bytes, 1 lines md5sums
268 bytes, 15 lines * postinst #!/bin/bash
139 bytes, 7 lines * postrm #!/bin/sh
45 bytes, 0 lines shlibs
Package: libmysqlclient20
Architecture: amd64
Version: 5.7.9
Section: libs
Depends: mysql-common (>= 5.7.9)
Provides: libmysqlclient15, libmysqlclient18
Conflicts: libmysqlclient15, libmysqlclient18
Replaces: libmysqlclient15, libmysqlclient18
Installed-Size: 4565
Description: MySQL shared client libraries
The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
and robust SQL (Structured Query Language) database server. MySQL Server
is intended for mission-critical, heavy-load production systems as well
as for embedding into mass-deployed software. MySQL is a trademark of
Oracle. This package contains the shared libraries for MySQL client
applications.
Now when trying to install the libmysqlclient20, I do get a LOT of warnings about dependencies not being met:

Reading package lists… Done
Building dependency tree
Reading state information… Done
dovecot-mysql is already the newest version.
libdbd-mysql-perl is already the newest version.
libdbd-mysql-perl set to manually installed.
libmailutils4 is already the newest version.
mailutils is already the newest version.
mailutils set to manually installed.
libqt4-sql-mysql is already the newest version.
libqt4-sql-mysql set to manually installed.
php5-mysql is already the newest version.
php5-mysql set to manually installed.
zabbix-server-mysql is already the newest version.
You might want to run ‘apt-get -f install’ to correct these:
The following packages have unmet dependencies:
dovecot-mysql : Depends: libmysqlclient18 (>= 5.5.24+dfsg-1)
libdbd-mysql-perl : Depends: libmysqlclient18 (>= 5.5.24+dfsg-1)
libmailutils4 : Depends: libmysqlclient18 (>= 5.5.24+dfsg-1)
libqt4-sql-mysql : Depends: libmysqlclient18 (>= 5.5.24+dfsg-1)
mailutils : Depends: libmysqlclient18 (>= 5.5.24+dfsg-1)
php5-mysql : Depends: libmysqlclient18 (>= 5.5.24+dfsg-1)
zabbix-server-mysql : Depends: libmysqlclient18 (>= 5.5.24+dfsg-1)
Recommends: snmptt but it is not going to be installed
E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a solution).
What I can’t understand is that I did provide a “Provides” header in the control file as well as a “Replaces” header. How is it possible that, when I say the new package provides libmysqlclient18, it chooses to ignore that?

(and when I want to do apt-get -f install, it wants to remove the libmysqlclient20, and reinstall libmysqlclient18).

Would anyone know what I’m missing here?

Thanks!

wget http://repo.zabbix.com/zabbix/3.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.0-1+xenial_all.deb
dpkg -i zabbix-release_3.0-1+xenial_all.deb
sudo apt-get update && sudo apt-get upgrade

本文的评论功能被关闭了.