List installed dpkg and rpm packages with their size

Some time ago I found a small script dpkg-du used to list dpkg packages and size of files that belongs to them. Unfortunately I couldn`t find it now when I needed it, but few minutes with manual brought me to this trivial oneliner:

dpkg-query -W -f='${Installed-Size} ${Package}\n'

And here`s a rpm version:

rpm -qa --queryformat '%{SIZE} %{NAME}\n'

Comments are closed.