How can I display a list of all rpm packages on the system with their sizes?

“rpm query size”

RPM (Red Hat Package Manager) has an excellent --qf (query format) option, which behaves much like printf function. Command rpm -q mozilla --qf '%{SIZE}
will display the size of mozilla package. To list all packages with their sizes, you may use something like: rpm -qa --qf '%-15{SIZE} %-30{NAME}\n' . The output of this command can be piped to sort -n to produce a list sorted by size.

Leave a Comment