Subscribe to How-To Geek

See What Version of a Package Is Installed on Ubuntu

The package management system on Ubuntu makes it extremely simple to install and remove packages, but sometimes it’s important to figure out what version of a particular package that you actually have installed.

The apt-get utilities are simply a front-end to the debian dpkg utility, which actually does the real work. You can use this utility to figure out what version is installed.

dpkg -s <packagename>

Here’s an example, where I was trying to figure out what version of Ruby I had installed on my system:

geek@ubuntuServ:~$ dpkg -s ruby1.8

Package: ruby1.8
Status: install ok installed
Priority: optional
Section: interpreters
Installed-Size: 272
Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
Architecture: i386
Version: 1.8.4-5ubuntu1.2
Depends: libc6 (>= 2.4-1), libruby1.8 (>= 1.8.4)
Suggests: ruby1.8-examples, rdoc1.8, ri1.8
Description: Interpreter of object-oriented scripting language Ruby 1.8
Ruby is the interpreted scripting language for quick and easy
object-oriented programming. It has many features to process text
files and to do system management tasks (as in perl). It is simple,
straight-forward, and extensible.
.
This package provides version 1.8 series of Ruby.
.
On Debian, Ruby 1.8 is provided as separate packages. You can get
full Ruby 1.8 distribution by installing following packages.
.
ruby1.8 ruby1.8-dev ri1.8 rdoc1.8 irb1.8 ruby1.8-elisp
ruby1.8-examples libdbm-ruby1.8 libgdbm-ruby1.8 libtcltk-ruby1.8
libopenssl-ruby1.8 libreadline-ruby1.8
Original-Maintainer: akira yamada <akira@debian.org>

You can see that I’ve got version 1.8.4 installed.

| More
This article was originally written on 12/16/06 Tagged with: Adding Software, Ubuntu, Ubuntu Tips & Tweaks

Daily Email Updates

You can get our how-to articles in your inbox each day for free. Just enter your name and email below:


Name:
Email:

Comments (4)

  1. amir

    apt-show-versions is a gem of a tool
    (you need to sudo apt-get install apt-show-versions)

    apt-show-versions -a

    lists all available versions on the apt repository servers (aswell as the installed version, if there is one)

    This is occasionally very useful

  2. amir

    The previous comment was supposed to show the example as:

    apt-show-versions -a <packagename>

    I hope that works better!! Wot no preview?!

  3. amir

    that’s better. Here’s what the output looks like

    amir@amir-desktop:~$ apt-show-versions -a ruby
    ruby 1.8.2-1 install ok installed
    No stable version
    ruby 1.8.2-1 dapper
    ruby/dapper uptodate 1.8.2-1

  4. lonny27

    dpkg is also a good option, especially if you don’t know the exact package name

    :~$ dpkg -l
    or in combination with grep
    :~$ dpkg -l | grep ruby
    or if you expecting a lot of matches
    :~$ dpkg -l | grep lib | less

    you can also use regular expression patterns with grep


Leave a Comment




Leave your friendly comment here.

If you have a computer help question, click here to leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Our Friends
Getting Started


About How-To Geek
What Is That Process?
svchost.exe
jusched.exe
dwm.exe
ctfmon.exe
wmpnetwk.exe
wmpnscfg.exe
rundll32.exe
wfcrun32.exe
Ipoint.exe
Itype.exe
Wfica32.exe
Mobsync.exe
conhost.exe
Dpupdchk.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. All Rights Reserved.