Thursday, November 5, 2009

How to remove 32/64 bit RPM's from your system

Sometimes you will find yourself in a situation where you install 32/64 bit RPM's of a certain package in your system as shown below,

On a RHEL 5 system,

[root@host php-5.3.0]# rpm -qa | grep libtool-ltdl
libtool-ltdl-devel-1.5.22-6.1
libtool-ltdl-1.5.22-6.1
libtool-ltdl-1.5.22-6.1
libtool-ltdl-devel-1.5.22-6.1

Ok - so how will you tell which are 32/64 bit packages?

[root@host php-5.3.0]# rpm -qa --queryformat "%{name}.%{version}.%{arch}\n" |grep libtool-ltdl

libtool-ltdl-devel.1.5.22.x86_64
libtool-ltdl.1.5.22.x86_64
libtool-ltdl.1.5.22.i386
libtool-ltdl-devel.1.5.22.i386

Ok - So lets remove the 32 bit ones..

[root@host php-5.3.0]# rpm -e libtool-ltdl.1.5.22.i386
error: package libtool-ltdl.1.5.22.i386 is not installed

RPM doesn't allow you to remove the package as its named differently in the RPM database.

Here is how you do it.. although it maybe crude.. (suggestions are welcome)

[root@host php-5.3.0]# rpm -e libtool-ltdl-1.5.22-6.1 --allmatches --nodeps
This removes all packages matching the entries given and ignore dependency errors.
[root@host php-5.3.0]# rpm -e libtool-ltdl-devel-1.5.22-6.1 --allmatches --nodeps

[root@host php-5.3.0]#rpm -qa | grep libtool-ltdl
[root@host php-5.3.0]#

Now just install your 64 bit RPM.

Errors on enabling Imap module for PHP 5.3

configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.

OS - RHEL 5 x86_64
Configure PHP 5.3.0

./configure --with-imap=/home/krishna/courier-imap-4.6.0 --with-kerberos --with-imap-ssl --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache2/bin/apxs --with-mcrypt --with-gd --enable-mbstring --with-gettext --enable-bcmath --enable-calendar --enable-wddx

To correct this,

Install libc-client-2004g-2.2.1.x86_64.rpm & libc-client-devel-2004g-2.2.1.x86_64.rpm

This should correct the errors.

---------


Ok - here is another,

configure: error: Cannot find imap library (libc-client.a). Please check your c-client installation

Create a soft link to the 32-bit libraries.

ln -s /usr/lib64/libc-client.a /usr/lib/libc-client.a

Run configure again and you shouldn't see this error.

-----------