Why does dpkg -p packageName for some package (example adduser, dash) display info thereof, but for other package like nodejs, git, firefox display dpkg-query: package name is not available?


The manual explains it ;-) man dpkg-query:

-p, --print-avail [package-name...]
       Display details about packages, as found in
       /var/lib/dpkg/available.  If no package-name is specified, it will
       display all package entries in the available database (since dpkg
       1.19.1).  When multiple package-name are listed, the requested
       available entries are separated by an empty line, with the same
       order as specified on the argument list.

       Users of APT-based frontends should use `apt show package-name`
       instead as the available file is only kept up-to-date when using

The last sentence explains it: use apt show package-name


$ apt show firefox
Package: firefox
Version: 87.0+build3-0ubuntu4
Priority: optional
Section: web
Origin: Ubuntu

$ apt show git
Package: git
Version: 1:2.30.2-1ubuntu1
Priority: optional
Section: vcs
Origin: Ubuntu


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.