Linux

Show and remove i386 RPMs from CentOS and RHEL

If you install CentOS somehow lots of i386 rpms will be installed, which you actually won’t need.
But how to remove those i386 rpms and free up some diskspace?
Took me some time to figure this out.

To show all installed i386 rpms (as well as the i586 and i686 packages):
# rpm -qa --queryformat='%{n}-%{v}-%{r}.%{arch}\n' | grep '\.i[3456]86$'

To show all installed noarch rpms:
# rpm -qa --queryformat='%{n}-%{v}-%{r}.%{arch}\n' | grep '\.noarch$'

To Delete all installed i386 rpms (as well as the i586 and i686 packages):
# rpm -qa --queryformat='%{n}-%{v}-%{r}.%{arch}\n' | grep '\.i[3456]86$' | xargs rpm -ev

To prevent i386 packages getting installed by yum add this to /etc/yum.conf
exclude=*.i386 *.i586 *.i686"

Leave a Reply


}) _0- O-) ;) ;( :{ :o :Y :X :P :N :D :@ :? :9~ :) :(