Find out the package version before installing it on Ubuntu and other dpkg based distros

Sometimes you may need to find out a package’s version available in the repository, before installing the package. There are a few ways to achieve this.

The easiest way to do this is to use the apt-cache tool. Like this:

Command one: apt-cache showpkg

$ apt-cache showpkg transmission

You can also use apt-cache show <packagename>, but it will display less information than apt-cache showpackage <packagename>.

Command two: apt-cache policy

$ apt-cache policy transmission

You can combine the two commands I have previously showed you with grep, for a better output:

$ apt-cache showpkg transmission | grep -i version

$ apt-cache policy transmission | grep -i version

You can also find out package information with dpkg. Read this article for more info.

Tagged with: , , , , ,
Posted in The Linux and Unix Articles!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Subscribe

  

Subscribe to get the latest Linux news and how to guides directly on your e-mail!