How to install MariaDB rpms in CentOS 6.4 using rpm (not yum cmd) + handling mysql-libs conflicts

I need to script the install of MariaDB using the rpm command in CentOS 6.4. I can't use yum since it's gong to be an offline install so there's no live access to the repository.

The only MySQL package installed is mysql-libs as various other packages depend on it. When I did a test install of MariaDB with yum using the command:

yum install MariaDB-client MariaDB-common MariaDB-compat MariaDB-devel MariaDB-server MariaDB-shared

It correctly accounted for mysql-libs and uninstalled it at the end as MariaDB could handle the dependencies after it was installed:

Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package MariaDB-client.x86_64 0:5.5.32-1 will be installed ---> Package MariaDB-common.x86_64 0:5.5.32-1 will be installed ---> Package MariaDB-compat.x86_64 0:5.5.32-1 will be obsoleting ---> Package MariaDB-devel.x86_64 0:5.5.32-1 will be installed ---> Package MariaDB-server.x86_64 0:5.5.32-1 will be installed ---> Package MariaDB-shared.x86_64 0:5.5.32-1 will be obsoleting ---> Package mysql-libs.x86_64 0:5.1.66-2.el6_3 will be obsoleted --> Finished Dependency Resolution

Dependencies Resolved

Package Arch Version Repository Size

Installing: MariaDB-client x86_64 5.5.32-1 mariadb 10 M MariaDB-common x86_64 5.5.32-1 mariadb 23 k MariaDB-compat x86_64 5.5.32-1 mariadb 2.7 M replacing mysql-libs.x86_64 5.1.66-2.el6_3 MariaDB-devel x86_64 5.5.32-1 mariadb 5.6 M MariaDB-server x86_64 5.5.32-1 mariadb 34 M MariaDB-shared x86_64 5.5.32-1 mariadb 1.1 M replacing mysql-libs.x86_64 5.1.66-2.el6_3

Transaction Summary

My question is, what is the equivalent way to install the MariaDB packages using the rpm command only as opposed to yum?

If I do rpm -ivh MariaDB*.rpm, I will get a ton of messages like the following about conflicts with mysql-libs:

file /etc/my.cnf from install of MariaDB-common-5.5.32-1.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64 file /usr/share/mysql/charsets/Index.xml from install of MariaDB-common-5.5.32-1.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64

I used the --force option to install and then uninstalled mysql-libs and didn't get any weird messages but I'm not sure that is the cleanest method to handle the conflicts.

So can someone confirm that installing MariaDB with the following rpm commands would be the same as using yum to install the packages and handle mysql-libs conflicts/removal:

rpm -ivh --force MariaDB*.rpm

rpm -e mysql-libs

Thanks for any input!

Answer

I suppose it's better first to remove mysql-libs (with --nodeps) and then install MariaDB.

But really you should use yum. It can do offline installs too. See, for example, our installation tests that we do on CentOS 6 for every change in the code (go to http://buildbot.askmonty.org/buildbot/grid?branch=5.5, click on any of the "OK" links for the centos6 builder and then on "stdio" under the "test install"). We use the command:

sudo yum -C -y --nogpgcheck install rpms/*.rpm

which, exactly, installs a set of *.rpm files and is not going to any repository.

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.