Table of Contents
Generating Lists of Currently Installed Packages
There are two methods to generate packages to weed through. The first method outputs all packages, including their file size, to a text file. The other is a direct output directly to the console.
Via list
dpkg --get-selections | cut -f1 | while read pkg; do dpkg -L $pkg | xargs -I'{}' bash -c 'if [ ! -d "{}" ]; then echo "{}"; fi' | tr'\n' '\000' | du -c --files0-from - | tail -1 | sed "s/total/$pkg/"; done | sort -rn > ~/packages.log.txt
Via output to console
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n