MariaDB packages don't obsolete MySQL rpms

Bug #857995 reported by Jascha Lee
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MariaDB
New
Medium
Sergei Golubchik

Bug Description

Since the files contained in the MariaDB rpms conflict with those in the MySQL rpms, this should be reflected in the MariaDB spec files. This will enable yum to handle this at the package level, rather than find out when it tries to install the files.

Ideally, each MariaDB package would "Obsolete" the corresponding MySQL package. This should allow the MariaDB package to be yum/rpm installed on a system with MySQL installed, with yum/rpm automatically removing the MySQL rpm.

This is accomplished by adding an "Obsoletes : " tag to the rpm spec file and listing the package to be replaced in the same way as a "Requires :" tag.

Tags: packaging
Revision history for this message
Colin Charles (ccharles) wrote :

Hi!

We do provide the Obsoletes: tag in RPM. Where are you getting this from? mysql, mysql-server, etc. are obsoleted.

Please provide where you got the RPM from and why yum didn't handle it.

Thanks

tags: added: packaging
Revision history for this message
Jascha Lee (jascha-q) wrote : Re: [Bug 857995] Re: MariaDB packages don't obsolete MySQL rpms

Hmnnn... Looking closer at the RPMs, they do obsolete mysql. I suspect the problem I ran into is I had the -enterprise-gpl versions installed (e.g. MySQL-client-enterprise-gpl.x86_64). For example:

MariaDB-shared-5.2.7-101.el5.x86_64 obsoletes mysql-shared
but
MySQL-shared-enterprise-gpl-5.0.72sp1-0.rhel5.x86_64 provides MySQL-shared

could the case difference cause a problem?

It could also be just a shortcoming of yum/rpm. In any case, I had to first remove the MySQL packages rather than having them removed automatically when installing MariaDB.

Thanks,
Jascha

On Nov 12, 2011, at 7:04 AM, Colin Charles wrote:

> Hi!
>
> We do provide the Obsoletes: tag in RPM. Where are you getting this
> from? mysql, mysql-server, etc. are obsoleted.
>
> Please provide where you got the RPM from and why yum didn't handle it.
>
> Thanks
>
> ** Tags added: packaging
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/857995
>
> Title:
> MariaDB packages don't obsolete MySQL rpms
>
> Status in Maria:
> New
>
> Bug description:
> Since the files contained in the MariaDB rpms conflict with those in
> the MySQL rpms, this should be reflected in the MariaDB spec files.
> This will enable yum to handle this at the package level, rather than
> find out when it tries to install the files.
>
> Ideally, each MariaDB package would "Obsolete" the corresponding MySQL
> package. This should allow the MariaDB package to be yum/rpm
> installed on a system with MySQL installed, with yum/rpm automatically
> removing the MySQL rpm.
>
> This is accomplished by adding an "Obsoletes : " tag to the rpm spec
> file and listing the package to be replaced in the same way as a
> "Requires :" tag.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/maria/+bug/857995/+subscriptions

Revision history for this message
Kolbe (kolbe) wrote :
Download full text (3.5 KiB)

I think including the Obsoletes is a mistake for a couple different reasons.

Many folks set up their own repository for use with yum and they put MariaDB packages into that repository to ease rollout to their various hosts. The side-effect of building the MariaDB-Server RPM with these Obsoletes is that it becomes impossible to install MySQL packages that might also be present in the repository. I am not referring here to someone trying to install MySQL and MariaDB simultaneously on the same host; rather, I am referring to someone wanting to be able to select whether to install MySQL or MariaDB, RPMs for both of which are present in their yum repository.

[root@mariadb53 ~]# yum install mysql-server mysql
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.fdcservers.net
* extras: mirror.fdcservers.net
* updates: mirror.fdcservers.net
Setting up Install Process
Package mysql-server is obsoleted by MariaDB-server, trying to install MariaDB-server-5.5.27-1.x86_64 instead
Package mysql is obsoleted by MariaDB-server, trying to install MariaDB-server-5.5.27-1.x86_64 instead

This illustrates that an attempt to install (upgrade is also affected!) MySQL from the user's own repository results in MariaDB *automatically* being selected for installation instead.

You may note, here, that MariaDB-Server obsoletes "mysql", which is very strange. In Enterprise Linux, "mysql" is the *client* package ("mysql.x86_64 : MySQL client programs and shared libraries"). By building the MariaDB-Server to Obsolete "mysql", an attempt to install the *MySQL* client will result in the *MariaDB* _Server_ being installed! That is, surely, not intended or desirable...

So, I have two concerns here:

1) Why does MariaDB "Obsolete" any of these other MySQL packages? I had trouble finding good guidance about what "Obsolete" is used for, but I did find http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch-dependencies.html#RPM_Guide-Dependencies-obsoletes which explains it in this way:

The RPM system supports one more type of dependency, called obsoletes. This refers to a capability that a package provides that makes another capability obsolete. For example, a new version of the perl interpreter may make an older version obsolete. In most cases, the obsoletes dependency should be used when the name of a package changes. For example, the apache Web server package became the httpd package. You would expect the new package, httpd, to obsolete the old package name, apache.

MariaDB-Server is certainly not a renamed version of MySQL, nor does it logically make MySQL "obsolete". The two certainly *conflict*, but it does not make sense (except perhaps in a political sense!) to say that MariaDB makes MySQL "obsolete".

The first "Obsolete" in the spec is to make "MariaDB" obsoleted by "MariaDB-Server". If there is some previous RPM of MariaDB that was called only "MariaDB" and contained mysqld, it *does* make sense to leave that one in, as this is a case of the package being renamed from "MariaDB" to "MariaDB-Server".

I am interested to know the logic behind putting these other Obsolete lines into the spec. What ...

Read more...

Revision history for this message
Jascha Lee (jascha-q) wrote :

These are good points. The benefit of the automatic upgrade could be more than offset by the lack of flexibility and the ability to maintain installs of either MySQL or MariaDB hosts from the same repository.

If there are Obsoletes in the packages they should be consistent. So maybe remove them all?

As to your question about the mysql Obsoletes. These refer to "providers", not necessarily package names:

http://www.rpm.org/max-rpm/s1-rpm-inside-tags.html

http://www.rpm.org/max-rpm/ch-rpm-depend.html

Revision history for this message
Sergei Golubchik (sergii) wrote :

Follow this bug in MariaDB bug tracker at https://mariadb.atlassian.net/browse/MDEV-747

Changed in maria:
assignee: nobody → Sergei (sergii)
milestone: none → 5.5
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.