Finding package versions

Sometimes people get a bit confused about how to tell what version of a package they have installed via Fink. Let’s clarify this a bit.

One of the basic fink tools is the fink list command.  However, one needs to be careful in interpreting the version it returns.  As an example from one of my systems:

$ fink list treeline
Information about 9038 packages read in 3 seconds.
(i)  treeline         1.2.2-1      Tree-based organization tool

This does not indicate that I have treeline-1.2.2-1 installed.  What this actually means is that treeline-1.2.2-1 is the latest version that fink knows about, and that I have some version installed, as noted by the i marker,  but that it is not the latest one, since it’s enclosed in (). (This information is covered in the fink manpage).  Note that whatever is before the last ‘-‘, 1.2.2 in this case, normally denotes the version of the package as defined by its developer(s), while what comes after the ‘-‘, 1 here, is a revision number specific to Fink’s packaging.

OK.  So we know what I don’t have installed, but how do we get at what I do have?  There are a few ways:

  1. When the package contains an executable program, that program often provides some sort of option to display this information, such as via a –version flag or something similar, or an “About” menu item in a GUI application (as is the case for treeline).
    This, however, won’t give you any information about what Fink revision of the package you’re on.
  2. ii  treeline       1.2.2-1        Tree-based organization tool

    (lifted from Max Horn’s comment below):

    Using dpkg -l will provide the currently installed version of a package:

    $ dpkg -l treeline
    Desired=Unknown/Install/Remove/Purge/Hold| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
    |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
    ||/ Name           Version        Description
    +++-==============-==============-============================================
    ii  treeline       1.2.2-1        Tree-based organization tool
  3. The fink tool provides a way to dump all of the versions of the package that it has package descriptions for (in the  stable, unstable, or local trees):
  4. $ fink dumpinfo -fallversions treeline
    Information about 9038 packages read in 3 seconds.
    allversions:
    bi     1.2.1-1
    b      1.2.2-1

    The b markers indicate that the package is known to be available in binary form (either locally, or by an official or unofficial binary distribution).  The i marker by version 1.2.1-1 indicates that this version is the one that is installed.

  5. One can also check via binary methods, e.g.:
    $ apt-cache policy treeline
    treeline:
    Installed: 1.2.2-1
    Candidate: 1.2.2-1
    Version Table:
    *** 1.2.2-1 0
    500 file: unstable/main Packages
    500 http://fink.sodan.ecc.u-tokyo.ac.jp unstable/main Packages
    100 /sw/var/lib/dpkg/status
    1.2.1-1 0
    500 http://fink.sodan.ecc.u-tokyo.ac.jp unstable/main Packages
    1.2.0-2 0
    500 http://fink.sodan.ecc.u-tokyo.ac.jp unstable/main Packages

    or

    $ apt-cache showpkg treeline
    Package: treeline
    Versions:
    1.2.2-1(/sw/var/lib/apt/lists/fink.sodan.ecc.u-tokyo.ac.jp_apt_10.5_dists_unstab
    le_main_binary-darwin-powerpc_Packages)
    1.2.1-1(/sw/var/lib/apt/lists/_sw_fink_dists_unstable_main_binary-darwin-powerpc
    _Packages)(/sw/var/lib/apt/lists/fink.sodan.ecc.u-tokyo.ac.jp_apt_10.5_dists_uns
    table_main_binary-darwin-powerpc_Packages)(/sw/var/lib/dpkg/status)
    1.2.0-2(/sw/var/lib/apt/lists/fink.sodan.ecc.u-tokyo.ac.jp_apt_10.5_dists_unstab
    le_main_binary-darwin-powerpc_Packages)
    1.0.2-1(/sw/var/lib/apt/lists/fink.sodan.ecc.u-tokyo.ac.jp_apt_10.5_dists_unstab
    le_main_binary-darwin-powerpc_Packages)
    • This shows the versions that are known to be available in binary form, as well as where they’re available from:  in this case several versions are available at fink.sodan.ecc.u-tokyo.ac.jp, and the one that has _sw_fink_dists_unstable_main_binary-darwin-powerpc_Packages, which is 1.2.1-1 here, was compiled on my system.
    • Whichever version is marked with (/sw/var/lib/dpkg/status), 1.2.1-1 in this case,  is the one that is installed.

3 responses to “Finding package versions

  1. Another approach, which should always work and maybe is a bit easier to use and remember, is

    dpkg -l treeline

    which will output the exact version of the package installed. I don’t have treeline installed, but for “tree”, I get this:

    ii  tree                  1.5.2.2-1             Recursive directory listing program
    
  2. Alex Hansen

    Totally forgot about ‘dpkg -l’.

    All of these approaches give different data, so hopefully we cover the space of package version information.

  3. Pingback: Bug reports « Finkers

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s