Is the version of an apt package always the version of the contained software?

I am using wondershaper but it's hard to tell the version because it doesn't support -v or --version. So I run

apt show wondershaper

and it says Version: 1.1a-10.

But I don't know if it's the version of the package or the contained software.

So I want to know:

Is it 100% safe that apt show does tell the version of the contained software and not of the package itself?


Solution 1:

It is the version of a package. It can match some other version assigned by the software author, or not.

apt show shows exactly what the package maintainer wrote.

Solution 2:

Is it 100% safe that apt show does tell the version of the contained software and not of the package itself?

It is not 100% safe, at least if you mean the manifest version printed by the application program itself. See this example with the Ubuntu Startup Disk Creator. In this case I think that the maintainer forgot about the print statement in the program.

apt show lists data about packages

$ apt show usb-creator-gtk | grep -i version

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Version: 0.3.5ubuntu18.04.2

Version printed by the application program itself

$ usb-creator-gtk --version 2> /dev/null
0.3.3

apt-cache policy is another way to list data about packages

$ apt-cache policy usb-creator-gtk 
usb-creator-gtk:
  Installed: 0.3.5ubuntu18.04.2
  Candidate: 0.3.5ubuntu18.04.2
  Version table:
 *** 0.3.5ubuntu18.04.2 500
        500 http://se.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     0.3.5ubuntu18.04.1 500
        500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
     0.3.5 500
        500 http://se.archive.ubuntu.com/ubuntu bionic/main amd64 Packages

Solution 3:

Let's find out.

Our first stop is the Debian Package Tracker

  • This provides an upstream link
  • It also provides a history of imports. Looking at that history, we see that the -10 is added by Debian; it's the 10th pull of that upstream version.

Our next stop is that upstream source. Take a look at the changelog.

  • Version 1.1a is the upstream release number.

So the final result for version 1.1a-10 is that it's upstream version 1.1a. Everything after that is added by downstream distros for their own version control.