Show installed packages sorted by the size they occupy

This can be done astoundingly easy with only a single command – well, not including the sorting. I’m just writing about it since it took my quite a while to figure out how to do this and later on I had to say that even though I knew that dpkg-query exists but since I liked to dig around in the packagestatus file by myself I never really had a use for the command. Well, now I have.

dpkg-query --show --showformat='${Package;-20}\t${Status}\t${Installed-Size}\n' | sort -k 5 -n|grep -v deinstall

does the job. And afterwards it’s quite easy to kick out the big packets you never heard of or even used …