Статьи

Решение конфликтов установки RPM

Этот пост написан Игнасио Нином из MySQL Performance Blog.

В последнее время у нас было много сообщений о том, что RPM-пакеты для CentOS 5 (в основном) и CentOS 6 имеют проблемы при установке различных комбинаций наших продуктов, особенно с Percona Toolkit. Примерами ошибок, связанных с этими проблемами, являются lp: 1031427 и lp: 1051874 .

Эти проблемы возникают при попытке установить пакет из дистрибутива, который связан с версией libmysqlclient.so, поставляемой дистрибутивом (libmysqlclient.so.15 для CentOS 5 / libmysqlclient.so.16 для CentOS 6) и версией Percona Сервер, который зависит от другой версии libmysqlclient.so, обычно более новой. Ошибка lp: 1031427 является примером этого и показывает, как пакеты будут конфликтовать при попытке установить libmysqlclient.so.

Например, при установке php-mysql вместе с PS 5.5 в CentOS 6:

# yum -q install Percona-Server-server-55 php-mysql

Установка:
Percona-Server-server-55 x86_64 5.5.29-rel29.4.401.rhel6 percona 15 M
php-mysql x86_64 5.3.3-14.el6_3 обновления 79 k
Установка для зависимостей:
Percona-Server-client-55 x86_64 5.5. 29-rel29.4.401.rhel6 percona 7.0 M
Percona-Server-shared-51 x86_64 5.1.67-rel14.3.506.rhel6 percona 2.8 M
Percona-Server-shared-55 x86_64 5.5.29-rel29.4.401.rhel6 percona 787 k

Краткое описание транзакции
===================================================== ================================================== ================================================== =
Установить 5 пакетов

Это нормально [y / N]: y

Transaction Check Error:
file /usr/lib64/libmysqlclient.so conflicts between attempted installs of Percona-Server-shared-51-5.1.67-rel14.3.506.rhel6.x86_64 and Percona-Server-shared-55-5.5.29-rel29.4.401.rhel6.x86_64
file /usr/lib64/libmysqlclient_r.so conflicts between attempted installs of Percona-Server-shared-51-5.1.67-rel14.3.506.rhel6.x86_64 and Percona-Server-shared-55-5.5.29-rel29.4.401.rhel6.x86_64

The traditional solution for this situation was to provide a special package, Percona-Server-shared-compat (modeled after upstream’s MySQL-shared-compat) which would contain ALL versions of libmysqlclient.so.* together and wouldn’t conflict. Probably some of you are familiar with this approach.

 # yum -q install Percona-Server-server-55 Percona-Server-shared-compat php-mysql

Installing:
Percona-Server-server-55 x86_64 5.5.29-rel29.4.401.rhel6 percona 15 M
Percona-Server-shared-compat x86_64 5.5.29-rel29.4.401.rhel6 percona 3.4 M
php-mysql x86_64 5.3.3-14.el6_3 updates 79 k
Installing for dependencies:
Percona-Server-client-55 x86_64 5.5.29-rel29.4.401.rhel6 percona 7.0 M
Percona-Server-shared-55 x86_64 5.5.29-rel29.4.401.rhel6 percona 787 k

Transaction Summary
=====================================================================================================================================================
Install 5 Package(s)

Notice how PS-shared-compat installs along the -shared package, providing the older libmysqlclient.so.16 required by php-mysql.

However, this has proved non-intuitive and problematic, since the shared-compat package wouldn’t get selected unless explicitely installed — and many of our users would rather have it “just work” without requiring additional knowledge of what the particular workaround was, etc..

We’re now trying a solution in which our -shared packages won’t conflict anymore at libmysqlclient.so, so we are able to install them side-by-side, modelled after the mysql-libs packages provided by CentOS/Redhat. So even if the user wants to install PS 5.5 alongside packages that depend on 5.1/5.0, the -shared packages will work together. For example installing 5.5 and postfix in CentOS:

 # yum -q install Percona-Server-server-55 postfix

Installing:
Percona-Server-server-55 x86_64 5.5.29-rel29.4.402.rhel5 percona-testing 19 M
postfix x86_64 2:2.3.3-6.el5 base 3.8 M
Installing for dependencies:
Percona-SQL-shared-50 x86_64 5.0.92-b23.89.rhel5 percona-testing 1.8 M
Percona-Server-client-55 x86_64 5.5.29-rel29.4.402.rhel5 percona-testing 9.1 M
Percona-Server-shared-55 x86_64 5.5.29-rel29.4.402.rhel5 percona-testing 993 k

… and this will install without problems.

Additionally, this has the advantage of allowing an upgrade from 5.1 to 5.5 without uninstalling any software that depended on the old version.

# rpm -qa | grep ^Percona
Percona-Server-client-51-5.1.67-rel14.3.507.rhel6.x86_64
Percona-Server-shared-51-5.1.67-rel14.3.507.rhel6.x86_64
Percona-Server-server-51-5.1.67-rel14.3.507.rhel6.x86_64

In this case only Percona-Server-client-51 and Percona-Server-server-51 need be removed, allowing any package that depends on Percona-Server-shared-51 (providing libmysqlclient.so.16) to remain installed. After the server and client packages are uninstalled, you can install PS 5.5 without conflict.

The current package candidates for versions 5.0.92 (which required an update), 5.1.67-14.3 and 5.5.29-29.4 can be tested from the percona-testing repository. We encourage you to try these out and send us your feedback and/or file any bugs you find.

Installation instructions for Percona Testing repositories.

We’re aiming to include these fixes in our next releases of 5.1 and 5.5. Percona Toolkit users in particular will enjoy this update since it’ll mean no more trouble when installing it from repository!