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:

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

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

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

and use it like

rpm_size <package name>

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

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

Enhanced by Zemanta

About Amit Agarwal