Web lists-archives.com

Re: Debian testing - release number

On Thu, 5 Jul 2018 14:57:03 -0500
Nicholas Geovanis <nickgeovanis@xxxxxxxxx> wrote:

> I am rightly accused of relying too heavily on /etc/debian_version to
> detect my running release. But it seems clear
> to me that the "right", canonical way to detect this is to query the
> installed package base to extract a version/release
> number from a package name and/or version. So surely there is an
> "approved" tool for doing that. Hopefully OTHER THAN
> apt, aptitude, synaptic or apt-get; ideally simpler and easier to
> script than that.

I would expect dpkg to be a better bet than apt, as it's more primitive.
Manually, I use dpkg -l with a grep to find version numbers.

But it's odd that you're the first to point out (indirectly) that
knowing the version of Debian isn't that useful. This is *Debian*.
Quite a few users will have at least one backport or locally-compiled
package, and there will be a few people who have almost tamed a

If your application depends on a particular version of a *package*,
then it makes sense to enquire which version of that package is
installed, not which version of Debian is running.