You can try the query-format option to retrieve the total size of the installed packages, e.g.
Code:
$ rpm -q --qf '%11{SIZE} %{NAME}\n' coreutils
3999445 coreutils
You may want to know the size of all the installed packages and sort them. Here we go:
Code:
$ rpm -qa --qf '%11{SIZE} %{NAME}\n' | sort -k1n
Sizes are given in bytes.