List all installed rpm packages and it’s size

If you are looking for a command to see the disk usage by each of the rpm‘s then you can use this command:

1
 rpm -q --queryformat "%10{SIZE}\t%{NAME}\n"

And if you use this command very regularly then you can create an alias like

1
 alias rpm_size='rpm -q --queryformat "%10{SIZE}\t%{NAME}\n" '

and use it like

1
rpm_size <package name>

and if you wish to see all the packages then you can use the following:

1
rpm -qa -–queryformat=”%10{SIZE}\t%{NAME}\n” | sort -k1,1n

Enhanced by Zemanta

About Amit Agarwal