Removing all 32bit RPM packages

Submitted by dag on Fri, 2010/03/19 - 23:58

If you happen to come across a pure 64bit system that was installed the default way and includes lots of 32bit stuff. And you know for a fact all the 32bit functionality is not needed, just proceed to:

[root@system ~]# rpm -qa --qf '%{name}.%{arch}\n' | grep 'i[36]86$' | xargs rpm -e

Clean and simple...

Using YUM

I saw this on the Fedora mailing list a long time ago, not sure if it will work:

# yum remove \*.i?86

Yes, that yum command should

Yes, that yum command should work. It is in the CentOS FAQ as well:

How can I be certain this won't break my system?

How can I be sure I don't need any of the 32 bit functionality? Or, how did you become sure? I guess the only way to be really sure is to try it on a test system first.

You can find out in other ways.

If you're only using 64bit software, there is no reason to have 32bit software installed. But if you don't know what your system is doing, and software has been installed by others, you may indeed not know.

If you want to find out and it is operational, you could check with lsof and monitor open files using a systemtap script or using the auditing framework. Have it running for some time that is indicative of all functionality (including cron-jobs etc...) and then inspect the list of files/libraries that were used.

It should also not be that hard to automate so that it finds 32bit applications/libraries on your system. The end result would be that you have either an OK that the system can become 64bit pure, or that a certain set of files on your system require 32bit binaries.

I have done the above on systems where I knew from the start they were intended to be 64bit pure because I only use RPM packages and everything was available in 64bit.

I've always ...

I've always just done:

yum remove glibc.i686

Does the trick nicely. Anything not depending on glibc is going to be both unusual and probably something you want to keep (e.g. busybox-static).


I just installed a 32-bit package with yum by accident.
It used something like 46 32-bit dependencies.
Now that junk is of my machine!