dpkg-awk

Gawk script to parse /var/lib/dpkg/{status,available} and Packages

Install

All systems
curl cmd.cat/dpkg-awk.sh
Debian Debian
apt-get install dpkg-awk
Ubuntu
apt-get install dpkg-awk
image/svg+xml Kali Linux
apt-get install dpkg-awk
Windows (WSL2)
sudo apt-get update sudo apt-get install dpkg-awk
Raspbian
apt-get install dpkg-awk

dpkg-awk

Gawk script to parse /var/lib/dpkg/{status,available} and Packages

This script can parse the dpkg database files. It can do regular expressions on the fields, and only get what you want. It can also be made to output certain fields. As an added bonus, there is an option to sort the output. 'dpkg-awk "Status: .* installed$" -- Package Version Status' will output all installed packages, with only the listed fields. 'dpkg-awk -f=/var/lib/dpkg/available "Package:^[aA].*" -- Package Version' will output all available packages that start with the letter 'A.'