Packages, Ubuntu

View repository versions of a package

apt-cache policy <packageName>

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

Example:

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

Advertisements

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