The other day a friend of mine asked me how to check the latest available version of a package in the Ubuntu repositories. He just wanted to know the package's version, even if it is not installed locally. If you ever wondered how to check available version of a package in Ubuntu repositories, read on. It's not that difficult as you might think. We can do this two methods.
- The command line way
- Graphical way
1. Check available version of a package in Ubuntu repositories from command line
This is the easiest and quickest way to find a package version from command line.
Open your Terminal, and run the following command:
$ apt-cache policy <packageName>
For example, let us find out all available versions of Chromium web browser from the Ubuntu repositories.
To do so, run:
$ apt-cache policy chromium-browser
chromium-browser: Installed: (none) Candidate: 65.0.3325.181-0ubuntu1 Version table: 65.0.3325.181-0ubuntu1 500 500 http://in.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
As you see in the above output, the latest available version in the remote repository is 65.0.3325.181. This command also indicates in which repositories they are coming from.
You may wonder if the given package is installed or not. It's easy to find out too.
In the above output, you see two words namely Installed and Candidate.
- Installed : This will tell you the version that you have currently installed in your Ubuntu system. So, in our case, I didn't install chromium browser in my Ubuntu, hence it shows none. If it is installed, you will the version number after the term "Installed".
- Candidate : This is actual version that will be installed from the Ubuntu repositories when you install Chromium browser using apt-get.
Now let me check another package, say for example firefox.
$ apt-cache policy firefox
firefox: Installed: 59.0.2+build1-0ubuntu1 Candidate: 59.0.2+build1-0ubuntu1 Version table: *** 59.0.2+build1-0ubuntu1 500 500 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 Packages 100 /var/lib/dpkg/status
See? I have installed Firefox in my Ubuntu and the currently installed version is 59.0.2.
Here is two more commands to check the package version from Ubuntu repositories.
$ apt-cache showpkg chromium-browser
The above command will display the complete details of the package version along with all dependencies.
Here is yet another command that displays the package version from Ubuntu repositories.
$ apt-cache madison chromium-browser
chromium-browser | 65.0.3325.181-0ubuntu1 | http://in.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
Unlike the previous command, it will display the output in a neat format.
Well, now let us see the graphical way.
2. Check available version of a package in Ubuntu repositories from Ubuntu site
This method is for Ubuntu desktops. Open your web browser, and go to the following website.
Enter the name of the package version, and hit the Search button.
That's it. You'll see the available version of the package from the Ubuntu repositories.
This method has two advantages over the command line way.
First, We can search the package version for different Ubuntu releases. For example, you can search the available package version for a trusty version.
Second, you don't need an Ubuntu system. You can check the version from any distribution. All you need is an Internet connection, and a web browser.