View repository versions of a package

apt-cache policy <packageName>

This gives you information of all available package versions in the Ubuntu repositories.


user@hostname:~$ apt-cache policy openssh-server
 Installed: 1:6.6p1-2ubuntu2.6
 Candidate: 1:6.6p1-2ubuntu2.7
 Version table:
 1:6.6p1-2ubuntu2.7 0
 500 trusty-updates/main ppc64el Packages
 500 trusty-security/main ppc64el Packages
 *** 1:6.6p1-2ubuntu2.6 0
 100 /var/lib/dpkg/status
 1:6.6p1-2ubuntu1 0
 500 trusty/main ppc64el Packages

From the output, you can see that there are two versions available: 1:6.6p1-2ubuntu2.7 and 1:6.6p1-2ubuntu1. It also tells you which repositories they are coming from.

Installed: tells you the version you have installed. If you don’t have the package installed, you’ll see (none).

Candidate: is the version that will be installed if you use apt-get install openssh-server. If you want to install the other version, you would do apt-get install openssh-server=1:6.6p1-2ubuntu2.7.

See the original reference here.


Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s