The initial-status.gz and dpkg-query method from https://unix.stackexchange.com/a/80520/9132gives the most accurate and concise list for my needs. comm -13 \ <(gzip -dc /var/log/installer/initial-status.gz | sed -n ‘s/^Package: //p’ | sort) \ <(comm -23 \ <(dpkg-query -W -f=’${Package}\n’ | sed 1d | sort) \ <(apt-mark showauto | sort) \ ) Check_diff for i in `cat diff.txt`;do echo $i […]