Ubuntu

Check Available Version of a Package in Ubuntu

There are several ways to determine the version number of an available package in Ubuntu. The command line provides quick access to the available packages in Ubuntu. In this article, we will see how to check the available version of the package in Ubuntu from the command line.

We will explain different methods in this section of checking the Ubuntu package’s available version.

Always make sure to update your system as per the latest version available. So, execute the below command for it:

$ sudo apt-get update

Now, run the below command to check the available version of the Ubuntu package:

$ apt list <packageName>

Here, we want to check the available version of firefox using apt-get list available packages. That’s why we have executed the below command:

$ apt list firefox

As the above result suggests, we can use ‘-a’ to get the additional version-related information. So we have executed the following command:

$ apt list firefox -a

If you need more details about the available package, then use the following command:

$ apt show firefox

$ apt show firefox -a

Apt Cache Command

If you want to query the APT cache, then please use this command. Apt-cache command gives an operation to find and create appropriate output from the available package metadata. So, run the below command for it:

$ apt-cache policy <packageName>

For example, we will find out all the available versions of the Firefox web browser from the Ubuntu repository. For this, we get the command run by writing “firefox” instead of “package name” in the above command.

$ apt-cache policy firefox

After executing the above command, the system will provide brief details on the available version of the Firefox web browser. Along with this, this command also tells us from which repository this version is coming. The output also provides information on whether the package is installed.

In the above image, there are two words named candidate and install.

Installed

It shows us the version which is currently installed in the Ubuntu system.

Candidate

The candidate shows the package of that version in our Ubuntu system, which is to be installed. This example shows the version that we will install the Firefox browser from the Ubuntu repository using apt-get.

Through another command, we can display the package version from the Ubuntu repository. This command is something like this.

$ apt-cache madison <packageName>

To display the version on the repository, we will run a command like this.

$ apt-cache madison firefox

If we compare with the previous command, then this command displays the output in a clean format.

Aptitude Command

Ubuntu doesn’t offer aptitude, so please install it through this command:

$ sudo apt install aptitude -y

Now, check the available version of Firefox using the command given below:

$ aptitude versions <packageName>

Bonus Tip

This method applies specifically to Ubuntu desktops. Visit the Ubuntu packages website using any web browser. Press the search button after entering the name of the package version.

That’s all we need to do. This will display the installation package version available in the Ubuntu repository.

Wrapping Up

This was a brief overview of how to check the available versions of a package in Ubuntu from the command line. We have used specific examples of the Firefox browser so that our readers can understand better. Please visit our official website to learn more new things about Linux.

About the author

Prateek Jangid

A passionate Linux user for personal and professional reasons, always exploring what is new in the world of Linux and sharing with my readers.