How to check available version of a package in Ubuntu repositories
Today, 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 without installing it. I never knew that before, so I immediately went to askubuntu forums, and search for the answer. This is my first preference site where I regularly search for Ubuntu related help. Luckily, someone has already asked the same question. So, I wanted to share those instructions for the OSTechNix readers, and keep it myself for future reference.
If you wanted to check available version of a package in Ubuntu repositories, read on. It’s not that difficult.
We can do it 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: 49.0.2623.108-0ubuntu0.14.04.1.1113 Candidate: 49.0.2623.108-0ubuntu0.14.04.1.1113 Version table: *** 49.0.2623.108-0ubuntu0.14.04.1.1113 0 500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/universe amd64 Packages 500 http://security.ubuntu.com/ubuntu/ trusty-security/universe amd64 Packages 100 /var/lib/dpkg/status 34.0.1847.116-0ubuntu2 0 500 http://in.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
As you in the above output, the there are two versions available 49.0.2623.108, and 34.0.1847.116. This command will also indicates which repositories they are coming from.
Now, you might ask, is this package (Chromium in our case) is installed or not? It’s easy to find out too.
In the above output, you’ll see there is two words:
- Installed : This will tell you the version that you have installed in your Ubuntu system. So, in our case, the installed version of Chromium browser is 49.0.2623.108. If the package is not installed, you’ll see (none) in the above output.
- Candidate : This is actual version that will be installed when you install Chromium browser using apt-get.
There are also other couple of commands available 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 an another command that displays the package version from Ubuntu repositories.
apt-cache madison chromium-browser
chromium-browser | 49.0.2623.108-0ubuntu0.14.04.1.1113 | http://in.archive.ubuntu.com/ubuntu/ trusty-updates/universe amd64 Packages chromium-browser | 49.0.2623.108-0ubuntu0.14.04.1.1113 | http://security.ubuntu.com/ubuntu/ trusty-security/universe amd64 Packages chromium-browser | 34.0.1847.116-0ubuntu2 | http://in.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages chromium-browser | 34.0.1847.116-0ubuntu2 | http://in.archive.ubuntu.com/ubuntu/ trusty/universe Sources chromium-browser | 49.0.2623.108-0ubuntu0.14.04.1.1113 | http://in.archive.ubuntu.com/ubuntu/ trusty-updates/universe Sources chromium-browser | 49.0.2623.108-0ubuntu0.14.04.1.1113 | http://security.ubuntu.com/ubuntu/ trusty-security/universe Sources
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 some added advantages over the command line way.
Firstly, We can search the package version for different Ubuntu releases. For example, you can search the available package version for a trusty version.
Secondly, you don’t need an Ubuntu system. You can check the version from any distribution. All you need is an Internet connection, and web browser.
Hope this helps. That’s all for now. I will be here soon with another interesting article. Until then, stay tuned with OSTechNix, and please share this article to your social networks.