[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

dpkg/apt voodoo to ask "what version of <pkg> is installed, if any?"



I already have this and it's been working well for quite a while:

  dpkg-query --showformat '\${status}\t\${version}\n' -W $pkg

Unfortunately I've just discovered it fails when $pkg is a virtual
package, and I have no way to tell ahead of time if this is the case or
not (nor does the caller care).

Is there a single command that can do this for both virtual and real
packages, a la "rpm -q --whatprovides"?

Some searching turned up references to apt-cache dumpavail, but that
isn't restricted to the currently installed packages.  The --installed
option seems to be ignored for dump and dumpavail.

(Please CC me on replies.)
-kgd


Reply to: