I use dpkg -l to list installed packages on my Ubuntu system

It only displays packages in state "ii", except if I explicitly query a package:

| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                  Version      Architecture Description
un  linux-headers-686-pae <none>       <none>       (no description available)

How can I make dpkg -l display all packages, i.e. any package known to the system (not just installed ones)?

Extra: Can this information be obtained using apt-get or similar commands (not apt list)?


When dpkg -l isn’t given a pattern, it ignores packages marked as “not-installed”. To work around that, give it a pattern:

dpkg -l '*'

apt list is apt-specific, similar to dpkg-query (which handles dpkg -l), and doesn’t have an apt-get or apt-cache equivalent.

  • I though that apt was a front-end for apt-get, apt-cache, etc., so that whatever can be done with apt can be done with one of apt-* - isn't that true? What I mean is that apt-* came first, and then apt was invented, because people thought apt-* were too difficult to comprehend? – Shuzheng Mar 5 at 14:30
  • apt adds some of its own specific features; see man apt for details. – Stephen Kitt Mar 5 at 14:43

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.