Centos 7 x64, mysql-community 5.7 is installed from mysql57-community repo.

I am in the process of switching from mysql to percona. However, the first step is scary when I try to uninstall mysql.

Yum is removing system components such as crontabs and redhat-lsb-core alone with mysql.

# yum remove mysql-community-*
 Package                             Arch           Version                     Repository                                      Size
 mysql-community-client              i686           5.7.18-1.el6                @mysql57-community                              87 M
 mysql-community-common              i686           5.7.18-1.el6                @mysql57-community                             2.5 M
 mysql-community-libs                i686           5.7.18-1.el6                @mysql57-community                             7.8 M
 mysql-community-libs-compat         i686           5.7.18-1.el6                @mysql57-community                             4.8 M
 mysql-community-server              i686           5.7.18-1.el6                @mysql57-community                             699 M
Removing for dependencies:
 cronie                              i686           1.4.4-16.el6_8.2            @updates                                       169 k
 cronie-anacron                      i686           1.4.4-16.el6_8.2            @updates                                        38 k
 crontabs                            noarch         1.10-33.el6                 @anaconda-CentOS-201605211917.i386/6.8         2.4 k
 geoipupdate-cron                    noarch         2.3.1-2.el6                 @city-fan.org                                  113
 postfix                             i686           2:2.6.6-8.el6               @base                                          9.4 M
 redhat-lsb-core                     i686           4.0-7.el6.centos            @base                                           22 k
 sysstat                             i686           9.0.4-33.el6                @base                                          804 k

Transaction Summary
Remove       12 Package(s)

Why is that? Is there a graceful way to remove mysql?

This does not make sense because I installed mysql from mysql57-community repo. How could postfix depend on mysql?

So far my thought is re-install these packages after the switch is done. But I'd wish to find a better solution.

  • When you're install mysql? – Alexander Tolkachev Aug 11 '17 at 19:18
  • "How could postfix depend on mysql?" It could # ldd /usr/libexec/postfix/master | grep mysql libmysqlclient.so.18 => /usr/lib64/mysql/libmysqlclient.so.18 (0x00007f83f983b000) Have I missed something, but AFAIK CentOS 7 doesn't have builds for i686 architecture. – ALex_hha Aug 14 '17 at 18:58

Postfix depends on having a package that provides libmysqlclient.

You can remove the old packages (mysql57-community) and install the new ones (Percona) in a single yum transaction using yum swap. This will ensure that Postfix will have the dependency before and after the transaction and yum will not try to remove it.

yum swap -- install percona-whatever-etc -- remove mysql-whatever-etc

  • Good to know the command yum swap. Have been using centos for years not realizing this feature. – Reed Aug 12 '17 at 1:40
  • It's been added recently. In older versions you have to use the yum shell, put the commands in, then commit. – Florin Asăvoaie Aug 12 '17 at 1:58

I believe it's related to packages having mysql-community-libs as dependence, by the looks of the issue reported here.

To answer your question, postfix depends on it for its MySQL-backed database for virtuals, accesses and aliases (more details on the official docs).

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.