Skip to content

Instantly share code, notes, and snippets.

@jness
Created April 25, 2011 19:08
Show Gist options
  • Save jness/941016 to your computer and use it in GitHub Desktop.
Save jness/941016 to your computer and use it in GitHub Desktop.
yum replace mysql55.
1. Current Packages:
[root@208934-el5-64 ~]# rpm -qa | grep mysql
mysql-5.0.77-4.el5_5.4.x86_64
mysql-server-5.0.77-4.el5_5.4.x86_64
2. Performing Yum Replace:
[root@208934-el5-64 ~]# yum replace mysql --replace-with mysql55 --enablerepo=ius
Loaded plugins: replace, rhnplugin, security
Excluding Packages in global exclude list
Finished
Excluding Packages from Extra Packages for Enterprise Linux 5 - x86_64
Finished
Replacing packages takes time, please be patient...
WARNING: Unable to resolve all providers: ['config(mysql)', 'libmysqlclient.so.15()(64bit)', 'libmysqlclient.so.15(libmysqlclient_15)(64bit)', 'libmysqlclient_r.so.15()(64bit)', 'libmysqlclient_r.so.15(libmysqlclient_15)(64bit)', 'config(mysql-server)']
This may be normal depending on the package. Continue? [y/N] y
Resolving Dependencies
--> Running transaction check
---> Package mysql.x86_64 0:5.0.77-4.el5_5.4 set to be erased
--> Processing Dependency: libmysqlclient.so.15()(64bit) for package: perl-DBD-MySQL
--> Processing Dependency: libmysqlclient.so.15(libmysqlclient_15)(64bit) for package: perl-DBD-MySQL
---> Package mysql-server.x86_64 0:5.0.77-4.el5_5.4 set to be erased
---> Package mysql55.x86_64 0:5.5.10-1.ius.el5 set to be updated
--> Processing Dependency: mysql55-libs = 5.5.10-1.ius.el5 for package: mysql55
--> Processing Dependency: mysqlclient15 for package: mysql55
---> Package mysql55-server.x86_64 0:5.5.10-1.ius.el5 set to be updated
--> Processing Dependency: perl-DBD-MySQL for package: mysql55-server
--> Running transaction check
---> Package mysql55-libs.x86_64 0:5.5.10-1.ius.el5 set to be updated
---> Package mysql55-server.x86_64 0:5.5.10-1.ius.el5 set to be updated
--> Processing Dependency: perl-DBD-MySQL for package: mysql55-server
---> Package mysqlclient15.x86_64 0:5.0.92-1.ius.el5 set to be updated
---> Package perl-DBD-MySQL.x86_64 0:3.0007-2.el5 set to be erased
--> Processing Dependency: perl-DBD-MySQL for package: mysql55-server
--> Finished Dependency Resolution
mysql55-server-5.5.10-1.ius.el5.x86_64 from ius has depsolving problems
--> Missing Dependency: perl-DBD-MySQL is needed by package mysql55-server-5.5.10-1.ius.el5.x86_64 (ius)
mysql55-server-5.5.10-1.ius.el5.x86_64 from ius has depsolving problems
--> Missing Dependency: perl-DBD-MySQL is needed by package mysql55-server-5.5.10-1.ius.el5.x86_64 (ius)
--> Running transaction check
---> Package mysql55-server.x86_64 0:5.5.10-1.ius.el5 set to be updated
---> Package perl-DBD-MySQL.x86_64 0:3.0007-2.el5 set to be erased
--> Finished Dependency Resolution
Dependencies Resolved
============================================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================================
Installing:
mysql55 x86_64 5.5.10-1.ius.el5 ius 7.4 M
mysql55-server x86_64 5.5.10-1.ius.el5 ius 12 M
Removing:
mysql x86_64 5.0.77-4.el5_5.4 installed 8.1 M
mysql-server x86_64 5.0.77-4.el5_5.4 installed 22 M
Installing for dependencies:
mysql55-libs x86_64 5.5.10-1.ius.el5 ius 1.2 M
mysqlclient15 x86_64 5.0.92-1.ius.el5 ius 1.7 M
Transaction Summary
============================================================================================================================================================
Install 4 Package(s)
Upgrade 0 Package(s)
Remove 2 Package(s)
Reinstall 0 Package(s)
Downgrade 0 Package(s)
Total download size: 22 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): mysql55-libs-5.5.10-1.ius.el5.x86_64.rpm | 1.2 MB 00:00
(2/4): mysqlclient15-5.0.92-1.ius.el5.x86_64.rpm | 1.7 MB 00:00
(3/4): mysql55-5.5.10-1.ius.el5.x86_64.rpm | 7.4 MB 00:02
(4/4): mysql55-server-5.5.10-1.ius.el5.x86_64.rpm | 12 MB 00:04
------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 2.8 MB/s | 22 MB 00:07
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Repackaging : mysql 0/6
Repackaging : mysql-server 0/6
Installing : mysqlclient15 1/6
Installing : mysql55-libs 2/6
Installing : mysql55 3/6
Installing : mysql55-server 4/6
Erasing : mysql 5/6
Erasing : mysql-server 6/6
Removed:
mysql.x86_64 0:5.0.77-4.el5_5.4 mysql-server.x86_64 0:5.0.77-4.el5_5.4
Installed:
mysql55.x86_64 0:5.5.10-1.ius.el5 mysql55-server.x86_64 0:5.5.10-1.ius.el5
Dependency Installed:
mysql55-libs.x86_64 0:5.5.10-1.ius.el5 mysqlclient15.x86_64 0:5.0.92-1.ius.el5
Complete!
3. Verified RC script exist and is installed:
[root@208934-el5-64 ~]# chkconfig mysqld status
chkconfig version 1.3.30.2 - Copyright (C) 1997-2000 Red Hat, Inc.
This may be freely redistributed under the terms of the GNU Public License.
usage: chkconfig --list [name]
chkconfig --add <name>
chkconfig --del <name>
chkconfig [--level <levels>] <name> <on|off|reset|resetpriorities>
4. rc script is in place:
[root@208934-el5-64 ~]# /etc/init.d/mysqld status
mysqld is stopped
5. Checked RPM --scripts, the rc script should be chkconfig --add on status $1 = 1:
[root@208934-el5-64 ~]# rpm -q mysql55 --script
--script: unknown option
[root@208934-el5-64 ~]# rpm -q mysql55
mysql55-5.5.10-1.ius.el5.x86_64
[root@208934-el5-64 ~]# rpm -q mysql55-server --scripts
preinstall scriptlet (using /bin/sh):
/usr/sbin/groupadd -g 27 mysql >/dev/null 2>&1 || :
/usr/sbin/useradd -M -o -r -d /var/lib/mysql -s /bin/bash \
-c "MySQL Server" -u 27 mysql -g mysql > /dev/null 2>&1 || :
postinstall scriptlet (using /bin/sh):
if [ $1 = 1 ]; then
/sbin/chkconfig --add mysqld
fi
/bin/chmod 0755 /var/lib/mysql
/bin/touch /var/log/mysqld.log
preuninstall scriptlet (using /bin/sh):
if [ $1 = 0 ]; then
/sbin/service mysqld stop >/dev/null 2>&1
/sbin/chkconfig --del mysqld
fi
postuninstall scriptlet (using /bin/sh):
if [ $1 -ge 1 ]; then
/sbin/service mysqld condrestart >/dev/null 2>&1 || :
fi
6. status $1 = 1 in %post is 'install'
http://fedoraproject.org/wiki/Packaging/ScriptletSnippets#Syntax
1. Current Packages:
[root@208934-el5-64 ~]# rpm -qa | grep mysql
mysql-5.0.77-4.el5_5.4.x86_64
mysql-server-5.0.77-4.el5_5.4.x86_64
2. Performing Yum Replace:
[root@208934-el5-64 ~]# yum replace mysql --replace-with mysql55 --enablerepo=ius
Loaded plugins: replace, rhnplugin, security
Excluding Packages in global exclude list
Finished
Excluding Packages from Extra Packages for Enterprise Linux 5 - x86_64
Finished
Replacing packages takes time, please be patient...
WARNING: Unable to resolve all providers: ['config(mysql)', 'libmysqlclient.so.15()(64bit)', 'libmysqlclient.so.15(libmysqlclient_15)(64bit)', 'libmysqlclient_r.so.15()(64bit)', 'libmysqlclient_r.so.15(libmysqlclient_15)(64bit)', 'config(mysql-server)']
This may be normal depending on the package. Continue? [y/N] y
Resolving Dependencies
--> Running transaction check
---> Package mysql.x86_64 0:5.0.77-4.el5_5.4 set to be erased
--> Processing Dependency: libmysqlclient.so.15()(64bit) for package: perl-DBD-MySQL
--> Processing Dependency: libmysqlclient.so.15(libmysqlclient_15)(64bit) for package: perl-DBD-MySQL
---> Package mysql-server.x86_64 0:5.0.77-4.el5_5.4 set to be erased
---> Package mysql55.x86_64 0:5.5.10-1.ius.el5 set to be updated
--> Processing Dependency: mysql55-libs = 5.5.10-1.ius.el5 for package: mysql55
--> Processing Dependency: mysqlclient15 for package: mysql55
---> Package mysql55-server.x86_64 0:5.5.10-1.ius.el5 set to be updated
--> Processing Dependency: perl-DBD-MySQL for package: mysql55-server
--> Running transaction check
---> Package mysql55-libs.x86_64 0:5.5.10-1.ius.el5 set to be updated
---> Package mysql55-server.x86_64 0:5.5.10-1.ius.el5 set to be updated
--> Processing Dependency: perl-DBD-MySQL for package: mysql55-server
---> Package mysqlclient15.x86_64 0:5.0.92-1.ius.el5 set to be updated
---> Package perl-DBD-MySQL.x86_64 0:3.0007-2.el5 set to be erased
--> Processing Dependency: perl-DBD-MySQL for package: mysql55-server
--> Finished Dependency Resolution
mysql55-server-5.5.10-1.ius.el5.x86_64 from ius has depsolving problems
--> Missing Dependency: perl-DBD-MySQL is needed by package mysql55-server-5.5.10-1.ius.el5.x86_64 (ius)
mysql55-server-5.5.10-1.ius.el5.x86_64 from ius has depsolving problems
--> Missing Dependency: perl-DBD-MySQL is needed by package mysql55-server-5.5.10-1.ius.el5.x86_64 (ius)
--> Running transaction check
---> Package mysql55-server.x86_64 0:5.5.10-1.ius.el5 set to be updated
---> Package perl-DBD-MySQL.x86_64 0:3.0007-2.el5 set to be erased
--> Finished Dependency Resolution
Dependencies Resolved
============================================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================================
Installing:
mysql55 x86_64 5.5.10-1.ius.el5 ius 7.4 M
mysql55-server x86_64 5.5.10-1.ius.el5 ius 12 M
Removing:
mysql x86_64 5.0.77-4.el5_5.4 installed 8.1 M
mysql-server x86_64 5.0.77-4.el5_5.4 installed 22 M
Installing for dependencies:
mysql55-libs x86_64 5.5.10-1.ius.el5 ius 1.2 M
mysqlclient15 x86_64 5.0.92-1.ius.el5 ius 1.7 M
Transaction Summary
============================================================================================================================================================
Install 4 Package(s)
Upgrade 0 Package(s)
Remove 2 Package(s)
Reinstall 0 Package(s)
Downgrade 0 Package(s)
Total download size: 22 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): mysql55-libs-5.5.10-1.ius.el5.x86_64.rpm | 1.2 MB 00:00
(2/4): mysqlclient15-5.0.92-1.ius.el5.x86_64.rpm | 1.7 MB 00:00
(3/4): mysql55-5.5.10-1.ius.el5.x86_64.rpm | 7.4 MB 00:02
(4/4): mysql55-server-5.5.10-1.ius.el5.x86_64.rpm | 12 MB 00:04
------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 2.8 MB/s | 22 MB 00:07
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Repackaging : mysql 0/6
Repackaging : mysql-server 0/6
Installing : mysqlclient15 1/6
Installing : mysql55-libs 2/6
Installing : mysql55 3/6
Installing : mysql55-server 4/6
Erasing : mysql 5/6
Erasing : mysql-server 6/6
Removed:
mysql.x86_64 0:5.0.77-4.el5_5.4 mysql-server.x86_64 0:5.0.77-4.el5_5.4
Installed:
mysql55.x86_64 0:5.5.10-1.ius.el5 mysql55-server.x86_64 0:5.5.10-1.ius.el5
Dependency Installed:
mysql55-libs.x86_64 0:5.5.10-1.ius.el5 mysqlclient15.x86_64 0:5.0.92-1.ius.el5
Complete!
3. Verified RC script exist and is installed:
[root@208934-el5-64 ~]# chkconfig mysqld status
chkconfig version 1.3.30.2 - Copyright (C) 1997-2000 Red Hat, Inc.
This may be freely redistributed under the terms of the GNU Public License.
usage: chkconfig --list [name]
chkconfig --add <name>
chkconfig --del <name>
chkconfig [--level <levels>] <name> <on|off|reset|resetpriorities>
4. rc script is in place:
[root@208934-el5-64 ~]# /etc/init.d/mysqld status
mysqld is stopped
5. Checked RPM --scripts, the rc script should be chkconfig --add on status $1 = 1:
[root@208934-el5-64 ~]# rpm -q mysql55 --script
--script: unknown option
[root@208934-el5-64 ~]# rpm -q mysql55
mysql55-5.5.10-1.ius.el5.x86_64
[root@208934-el5-64 ~]# rpm -q mysql55-server --scripts
preinstall scriptlet (using /bin/sh):
/usr/sbin/groupadd -g 27 mysql >/dev/null 2>&1 || :
/usr/sbin/useradd -M -o -r -d /var/lib/mysql -s /bin/bash \
-c "MySQL Server" -u 27 mysql -g mysql > /dev/null 2>&1 || :
postinstall scriptlet (using /bin/sh):
if [ $1 = 1 ]; then
/sbin/chkconfig --add mysqld
fi
/bin/chmod 0755 /var/lib/mysql
/bin/touch /var/log/mysqld.log
preuninstall scriptlet (using /bin/sh):
if [ $1 = 0 ]; then
/sbin/service mysqld stop >/dev/null 2>&1
/sbin/chkconfig --del mysqld
fi
postuninstall scriptlet (using /bin/sh):
if [ $1 -ge 1 ]; then
/sbin/service mysqld condrestart >/dev/null 2>&1 || :
fi
6. status $1 = 1 in %post is 'install'
http://fedoraproject.org/wiki/Packaging/ScriptletSnippets#Syntax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment