Linux For Cynics One user's experiences with Linux

10Apr/130

Determine What Version of a Package is Installed on Ubuntu or Debian

If you want to find out what version of a package you have installed, dpkg will give you information concerning a package, including the version, if you use the "--status" option, like so:

$ dpkg --status packagename

where packagename is the package in question.

Now, it gives a lot more than the version.
For example,

$ dpkg --status openbox

Returns:

Package: openbox
Status: install ok installed
Priority: optional
Section: x11
Installed-Size: 1316
Maintainer: Debian QA Group 
Architecture: i386
Version: 3.5.0-7
Provides: x-session-manager, x-window-manager
Depends: libc6 (>= 2.2), libglib2.0-0 (>= 2.24.0), libice6 (>= 1:1.0.0), libobrender27 (>= 3.5.0), libobt0 (>= 3.5.0), libsm6, libstartup-notification0 (>= 0.7), libx11-6, libxau6, libxext6, libxinerama1, libxml2 (>= 2.7.4), libxrandr2, libxrender1
Pre-Depends: dpkg (>= 1.15.7.2)
Recommends: openbox-themes, obconf
Suggests: menu, ttf-dejavu, python, libxml2-dev
Breaks: menu (<< 2.1.12)
Conffiles:
 /etc/menu-methods/openbox 454ed1e8309e6fc60b0d16894d541dfd
 /etc/xdg/openbox/menu.xml 96647f77053f8d73987a6e2b77b18e8f
 /etc/xdg/openbox/rc.xml da6375c910abc7dfb69f26b6bd7deb70
 /etc/xdg/openbox/environment 34bbf463555dbfb8f97fe957489d73b7
 /etc/xdg/openbox/autostart 2e828424c93a51d910382b53a9729166
Description: standards compliant, fast, light-weight, extensible window manager
 Openbox works with your applications, and makes your desktop easier to manage.
 This is because the approach to its development was the opposite of what seems
 to be the general case for window managers.  Openbox was written first to
 comply with standards and to work properly.  Only when that was in place did
 the team turn to the visual interface.
 .
 Openbox is fully functional as a stand-alone working environment, or can be
 used as a drop-in replacement for the default window manager in the GNOME or
 KDE desktop environments.
 .
 Openbox 3 is a completely new breed of window manager.  It is not based upon
 any existing code base, although the visual appearance has been based upon
 that of Blackbox.  Openbox 2 was based on the Blackbox 0.65.0 codebase.
 .
 Some of the things to look for in Openbox are:
 .
  * ICCCM and EWMH compliance!
  * Very fast
  * Chainable key bindings
  * Customizable mouse actions
  * Window resistance
  * Multi-head Xinerama support!
  * Pipe menus
Homepage: http://www.openbox.org

So, to only see the version, just pipe the output of dpkg -status to grep, for example:

$ dpkg --status openbox | grep 'Version'

will output something like this:

Version: 3.5.0-7

Note, dpkg --status packagename can be replaced with any of the following:

$ dpkg -s packagename
$ dpkg-query --status packagename
$ dpkg-query -s packagename
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.