#!/usr/bin/env bash

set -o errexit

dpkg-query -f '${Package}\t${Status}\n' -W '*'

#!/usr/bin/env bash

set -o errexit

dpkg-query -f '${Package}\t${Status}\n' -W '*' | awk '{print $1"\t"$4}'

Print only the name and installation state
Print only the name and installation state

From
<https://askubuntu.com/questions/681170/how-to-get-installed-not-installed-state-of-all-packages#comment989406_681184>.
