This is with reference to "sudo: apt-get: command not found." after removing some packages. This user managed to break his system by installing some packages from wheezy on a squeeze system - not sure why or how. In any case, he has at least two packages which are not fully installed, and are in the state iU (i.e. unpacked only). What is an efficient way to list all packages that are not fully installed, or, putting it differently, partially installed?

This seems like something that might have already been asked, but a quick search did not uncover anything. If it is a duplicate, please close.


From the dpkg man page

  -C, --audit
          Searches for packages that have been installed only partially on your system. dpkg will suggest what to do with them to get them working.

So dpkg -C (as user) may work. However, I can't test this since I don't have any broken packages.

  • I confirmed on my VM that it works. But you may need to run with sudo.
    – yaobin
    Oct 7 '19 at 17:43
  • @yaobin I don't think you need to run this as root. You're just querying the dpkg database here. Oct 7 '19 at 19:47

I whould try something like this:

dpkg --list | grep -ve 'ii\|^rc'

Lists all packages that are not in state "installed" or "removed".


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.