If you’re running out of disk space and you want to quickly see what packages are using the most space on your hard drive, use the following command
dpkg-query --show --showformat='${Package;-50}\t${Installed-Size}\n' | sort -k 2 -n | grep -v deinstall | awk '{printf "%.3f MB \t %s\n", $2/(1024), $1}'
That will sort the packages by size, putting the largest ones on the bottom. If you only want to see the top few, you can type
tail -n 10
at the end, because in all likeliness you have a *lot* of packages installed