Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

My questions are divided into two parts:

  1. How to know the version of installed package?
  2. How to install a specific package version?
share|improve this question

marked as duplicate by karel, Braiam, BuZZ-dEE, Richard, Florian Diesch Mar 4 '14 at 23:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

How to know the version of installed package?

apt-cache policy <package name>

The above command will shows installed package version and also all the available versions in the repository according to the version of Ubuntu in which you are running.It doesn't display the package version which was intended for another version of Ubuntu(not your's).


$ apt-cache policy gparted
  Installed: 0.16.1-1
  Candidate: 0.16.1-1
  Version table:
 *** 0.16.1-1 0
        500 saucy/main amd64 Packages
        100 /var/lib/dpkg/status

So the installed gparted version is 0.16.1-1.

How to install a specific package version?

sudo apt-get install package=version


$ sudo apt-get install gparted=0.16.1-1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
gparted is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 265 not upgraded.
share|improve this answer
Can you please give more details for the second command? Are there any limitations? For example, could someone on 12.04 install a version of a package available in 13.10? – DK Bose Mar 3 '14 at 11:03
In aptitude pressing Enter on the package name displays information about the package and on the bottom of this screen there is a list of the available versions. – karatedog Feb 12 at 8:36

There is no general way to check the version of installed packages, but most of them can be checked using the command:

command -v 

for example to know the version of apache2:

apache2 -v

But this may not work with other packages so the best practice is to search the manual.

man XXX

and search for the option of showing the version.

To install a specific version of a package:

sudo apt-get install package=version

For example:

sudo apt-get install apache2=2.3.35-4ubuntu1
share|improve this answer
we can also check version of installed package using dpkg -l package-name – Nischay Mar 3 '14 at 9:37
Where do you find/track down the meta 2.3.35-4ubuntu1 when specifying the version? – Erutan409 May 23 at 15:32
@Erutan409 The comment above yours is how you can do that. – user124384 3 hours ago