3

We have a current version of our software that has a dependency on MySQL 5.1 and this is specified in the RPM requires.

For our new version, we now require MySQL 5.5 and specify this in the RPM requires:

[root@NEC03 ~]# rpm -q -R mypackage
/bin/sh  
/bin/sh  
/bin/sh  
/bin/sh  
/usr/bin/mysql  
config(flux) = 2.0.0.0-1
jdk >= 1.6
mysql-server >= 5.5.21
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1

However, when I run rpm -Uvh mypackage.rpm there is no exception about failing dependencies, although I only have MySQL 5.1 installed:

[root@NEC03 ~]# rpm -qa | grep -i mysql
MySQL-server-community-5.1.51-1.rhel5
MySQL-shared-community-5.1.51-1.rhel5
MySQL-client-community-5.1.51-1.rhel5

Any idea why rpm does not fail during the upgrade ?

Update:

The problem seems to be that MySQL-server-community provides mysql-server without a version number:

[root@NEC03 ~]# rpm -q --provides MySQL-server-community
MySQL  
MySQL-server  
config(MySQL-server-community) = 5.1.51-1.rhel5
ha_innodb_plugin.so.0()(64bit)  
msqlormysql  
mysql  
mysql-server  
MySQL-server-community = 5.1.51-1.rhel5

As a result, the version check in our requires is pretty useless and we will need to use 'MySQL-server-community' in the requires if version checking is needed, but MySQL 5.5 only provides MySQL-server with a version:

[root@NEC02 dependencies2.0]# rpm -q --provides MySQL-server
MySQL  
MySQL-server  
adt_null.so()(64bit)  
auth.so()(64bit)  
auth_socket.so()(64bit)  
auth_test_plugin.so()(64bit)  
config(MySQL-server) = 5.5.21-1.rhel5
libdaemon_example.so()(64bit)  
libtcmalloc_minimal.so.0()(64bit)  
msqlormysql  
mypluglib.so()(64bit)  
mysql  
mysql-server  
qa_auth_client.so()(64bit)  
qa_auth_interface.so()(64bit)  
qa_auth_server.so()(64bit)  
semisync_master.so()(64bit)  
semisync_slave.so()(64bit)  
MySQL-server = 5.5.21-1.rhel5

As a result, it does not seem possible to fix the problem, since MySQL 5.1 also provides 'MySQL-server' without a version.

0

3 Answers 3

1

You could actually resolve it by using

Conflicts: MySQL-server < 5.5

1

I solved the issue by adding this pre-install script to the RPM:

# Check that MySQL version is not 5.1
rpm -qa | grep -i mysql-server.*5.1 > /dev/null
if [ $? -eq 0 ]
then
    echo "Flux can not be installed because MySQL 5.1 is still installed. Please upgrade MySQL to 5.5 or above."
    echo
exit 1
fi

I did not manage to get it working with conflicts. I add the conflict on MySQL-server-community, but my application still installed.

[root@NEC01 ~]# rpm -q --conflicts myapplication
MySQL-server-community <= 5.1

While I have MySQL-server-community installed:

[root@NEC01 ~]# rpm -q --provides MySQL-server-community
MySQL  
MySQL-server  
config(MySQL-server-community) = 5.1.44-1.rhel5
ha_example.so.0()(64bit)  
ha_innodb_plugin.so.0()(64bit)  
msqlormysql  
mysql  
mysql-server  
MySQL-server-community = 5.1.44-1.rhel5
0

You could also put some Obsoletes statements into your rpm-definition.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .