Tuesday, August 18, 2009

Sort installed RPMs by size

Keep forgetting this one, to list all RPM packages installed on a Linux (Red Hat / CentOS) machine sorted from the largest to the smallest in size:

rpm -qa --queryformat '%{size} %{name}\n' | sort -rn | more

This outputs something like this:

[root@healthy ~]# rpm -qa --queryformat '%{size} %{name}\n' | sort -rn | more
87389896 kernel
66720559 glibc-common
35274936 perl
30873913 valgrind
28767659 selinux-policy-targeted
27805586 redhat-logos
27022854 valgrind
26982540 mesa-libGL
24517704 mesa-libGL
22091978 python
20474820 specspo


No comments: