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:

<img alt="" data-lazy- data-lazy-src="" data-lazy- height="403" src="data:image/svg xml,” width=”726″>

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

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:

<img alt="" data-lazy- data-lazy-src="" data-lazy- height="89" src="data:image/svg xml,” width=”722″>

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

<img alt="" data-lazy- data-lazy-src="" data-lazy- height="102" src="data:image/svg xml,” width=”719″>

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

<img alt="" data-lazy- data-lazy-src="" data-lazy- height="370" src="data:image/svg xml,” width=”721″>

<img alt="" data-lazy- data-lazy-src="" data-lazy- height="217" src="data:image/svg xml,” width=”717″>

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.

<img alt="" data-lazy- data-lazy-src="" data-lazy- height="242" src="data:image/svg xml,” width=”731″>

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


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


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

<img alt="" data-lazy- data-lazy-src="" data-lazy- height="136" src="data:image/svg xml,” width=”725″>

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>

<img alt="" data-lazy- data-lazy-src="" data-lazy- height="362" src="data:image/svg xml,” width=”704″>

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

<img alt="" data-lazy-src="" data-lazy- height="112" src="data:image/svg xml,” width=”112″>

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.