dpkg-awk command not found

In this troubleshooting guide we learn how to fix dpkg-awk command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

dpkg-awk: command not found

or when using sudo you get the following error message

sudo: dpkg-awk: command not found

Solutions to dpkg-awk: command not found

How To Fix dpkg-awk: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu dpkg-awk is provided by dpkg-awk package.

dpkg-awk is:

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.’

To fix this problem, we can install more using the command below.

sudo apt-get -y install dpkg-awk

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install dpkg-awk.

sudo apt -y install dpkg-awk

Or if you have aptitude installed you can use the following command.

sudo aptitude install dpkg-awk

Summary

In this tutorial we learn how to fix dpkg-awk command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.