Debian – How to find out half-configured/broken packages in Debian

aptaptitudedebiandpkgpackage-management

Is there a way to find half-configured packages in Debian ? This is coming from Debian strech – update broken – seems buggy dpkg .

I try to see if packages are broken by two ways –

a. $ aptb 

┌─[shirish@debian] - [~] - [5289]
└─[$] alias aptb

aptb='aptitude search '\''~b'\'

The more better one –

┌─[shirish@debian] - [~] - [5288]
└─[$] dpkg --audit

┌─[shirish@debian] - [~] - [5289]
└─[$]

Are there any other tools which do the desired/above thing ?

Update – I get this –

[$] dpkg -f '${status} ${package}\n' -W | awk '$2 == "half-configured" {print $4}'

dpkg-deb: error: failed to read archive '${status} ${package}\n': No such file or directory

[$] dpkg -f '${status} ${package}\n' -W | awk '$2 == "half-configured" {print $4}'                                           

dpkg-deb: error: failed to read archive '${status} ${package}\n': No such file or directory

Are these the expected outputs ?

Best Answer

Quick to type:

dpkg -l | grep -v '^ii'

This lists any package that's at least a little known to the system but not perfectly installed.

If you want parseable output, use dpkg-query with a custom format. Adjust the filter according to your wishes.

dpkg-query -f '${status} ${package}\n' -W | awk '$3 != "installed" {print $4}'
dpkg-query -f '${status} ${package}\n' -W | awk '$3 == "half-configured" {print $4}'
Related Question