Thursday, August 11, 2016

how to check current version of a linux package


Open your terminal with CTRL+ALT+T and then type the command

apt-cache policy <package name>

This gives you information of all available package versions and all the version details.

It also shows which version is currently installed and which versions are available to install.

For example,

alaa@aa-lu:~$ apt-cache policy vlc
vlc:
  Installed: 2.0.8-0ubuntu0.13.04.1
  Candidate: 2.0.8-0ubuntu0.13.04.1
  Version table:
 *** 2.0.8-0ubuntu0.13.04.1 0
        500 http://ae.archive.ubuntu.com/ubuntu/ raring-updates/universe i386 Packages
        500 http://security.ubuntu.com/ubuntu/ raring-security/universe i386 Packages
        100 /var/lib/dpkg/status
     2.0.6-1 0
        500 http://ae.archive.ubuntu.com/ubuntu/ raring/universe i386 Packages

    From the output, you can see that there are two versions available: 2.0.8-0ubuntu0.13.04.1 and 2.0.6-1. 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 vlc. If you want to install the other version, you would do apt-get install vlc=2.0.6-1.