4

I have a CentOS 6 host running a MySQL server. I want to migrate this server away from the MySQL Enterprise Server packages to MySQL Community Server packages, with the following specifics:

  • The MySQL Enterprise RPMs are called mysql-commercial-something and are at version '5.7.22-1.1'. I store these in a custom repo.
  • The Community RPMs are called mysql-community-something, and the latest available version is '5.7.22-1', which is a single '.1' release behind the Commercial version. These are stored in a public repo (http://repo.mysql.com/ ).

Since the Community RPM has version number which is slightly behind the Commercial version, I cannot simply swap out one package for another. Yum complains with the error "Package foo-1 is obsoleted by foo-1.1":

[root@devdb ~]# yum list --quiet available 'mysql-*-server'
Available Packages
mysql-community-server.x86_64                   5.7.22-1.el6                    mysql57-community
[root@devdb ~]# 
[root@devdb ~]# yum install --quiet mysql-community-server
Package mysql-community-server-5.7.22-1.el6.x86_64 is obsoleted by mysql-commercial-server-5.7.22-1.1.el6.x86_64 which is already installed
[root@devdb ~]# 

I've tried a couple things, such as specifying the specific version number presented in How to install an older version of php (5.2.17) in Linux?, but that doesn't work in this case:

[root@devdb ~]# yum install --quiet mysql-community-server-5.7.22-1.el6.x86_64 
Package mysql-community-server-5.7.22-1.el6.x86_64 is obsoleted by mysql-commercial-server-5.7.22-1.1.el6.x86_64 which is already installed
[root@devdb ~]#

How can I force Yum to use use a package with an older version number?

Stefan Lasiewski
  • 23,667
  • 41
  • 132
  • 186
  • Have you tried `yum remove mysql-community-server` first? – Nasir Riley May 22 '18 at 22:18
  • Yes. Unfortunately, that runs in to a common issue between the RHEL packages and the MySQL/MariaDB/Percona packages (See https://gist.github.com/stefanlasiewski/1d71ee0ece9c65bd1365968c954422c0 & https://forums.mysql.com/read.php?117,651266,651266,quote=1). It's a MySQL-specific issue that I didn't want to get into here. I'm hoping to work around this MySQL-specific issue by simply using Yum to install an equivalent version of mysql-community on this server. – Stefan Lasiewski May 22 '18 at 23:58
  • Then I don't know what to tell you. From what I can surmise from what you've shown on Github, you don't want to remove the dependencies (specifically percona). It doesn't look as though what you're doing is possible by using `yum` because what you're trying to install is obsoleted and conflicts with what's already installed and you can't remove the latter because you want the dependencies. The only solution that might work would be to build it from source which it doesn't look like is possible with this package. – Nasir Riley May 23 '18 at 00:20
  • 1
    Haven't tried this myself, but my first thought would be to run `yum downgrade mysql-community-server`. – Michael Hampton May 23 '18 at 00:46
  • 1
    Have you tried to run `yum clean` and then run `yum --disablerepo= install mysql-community-server`? – Alexander Tolkachev May 23 '18 at 20:40
  • @MichaelHampton A good idea. Unfortunately, `yum downgrade mysql-community-server` tells me `No Match for available package: mysql-community-server-5.7.9-1.el6.x86_64`. I'm confused why it would be suggesting such an old version. – Stefan Lasiewski May 23 '18 at 22:34
  • @AlexanderTolkachev Also a good idea. That almost works, but fails at the `Running Transaction Test` stage, with errors like `file /usr/sbin/mysqld from install of mysql-community-server-5.7.22-1.el6.x86_64 conflicts with file from package mysql-commercial-server-5.7.22-1.1.el6.x86_64`. – Stefan Lasiewski May 23 '18 at 22:36
  • You can give `yum downgrade` a specific version, too. – Michael Hampton May 24 '18 at 02:35
  • Unfortunately, `yum downgrade` to a specific version failed with the error `No Match for available package: mysql-community-libs-5.7.22-1.el6.x86_64`, which doesn't make sense to me as the packages definitely exist. https://gist.github.com/stefanlasiewski/edb1a11df5174b4d6ce34223cba10e43 . I chose a brute force method, as seen below. – Stefan Lasiewski May 31 '18 at 01:22

1 Answers1

2

I couldn't find a way to do this with Yum only. What I ended up doing was a two step process:

  1. Use rpm to remove the mysql-commercial-* packages, but don't remove any dependencies.

    [root@devdb ~]# rpm --erase --nodeps mysql-commercial-server mysql-commercial-libs-compat mysql-commercial-client mysql-commercial-common mysql-commercial-libs
    warning: /etc/my.cnf saved as /etc/my.cnf.rpmsave
    [root@devdb ~]#
    
  2. And then use Yum to install the mysql-community packages, at the closest version number I can find:

    [root@devdb ~]# yum --disablerepo=local-mysql-enterprise install mysql-community-libs-5.6.40-2.el6.el6.x86_64 mysql-community-common-5.6.40-2.el6.el6.x86_64 mysql-community-client-5.6.40-2.el6.el6.x86_64 mysql-community-libs-compat-5.6.40-2.el6.el6.x86_64 mysql-community-server-5.6.40-2.el6.el6.x86_64 
    ...
    Installed:
      mysql-community-client.x86_64 0:5.7.22-1.el6               mysql-community-common.x86_64 0:5.7.22-1.el6
        mysql-community-libs.x86_64 0:5.7.22-1.el6                 mysql-community-libs-compat.x86_64 0:5.7.22-1.el6
        mysql-community-server.x86_64 0:5.7.22-1.el6
    
    Complete!
    [root@devdb ~]#
    
  3. And restore some core files:

    [root@devdb ~]#cp /etc/my.cnf.rpmsave /etc/my.cnf
    [root@devdb ~]#
    
Stefan Lasiewski
  • 23,667
  • 41
  • 132
  • 186