If you’re a Debian user, you know how necessary it is to keep your software up-to-date. Installing the latest version of software packages can help improve the performance, security, and stability of your system. However, before updating a package, you need to know what version is currently installed on your system. There are different commands available through which you can check the installed package version. In this guide, we will discuss those commands in detail.
Check the Version of the Installed Package on Ubuntu/Debian
Following are the methods/commands that can be used to check the version of the installed package on Debian:
Depending on the package installed on your system, you can use -v or –version option to check the version of the installed package:
apt command has various options and one option is the list. It is used with the package name to check the version of the installed package. The general syntax of the command is:
Here I am using the apt list command to check the version of curl utility:
Use the flag -a to check all the options available for the specific package in the repository:
The apt-cache is the Debian command line tool that is used to query the APT cache. To get the output of the version of the installed package, run the following command:
Let’s check the version of curl with apt-cache:
In the above image the installed: 7.74.0-1.3+debllu7 shows the version of the curl, if the package is not installed on your system, you will see the none value for an installed option.
You can also use the aptitude command-line tool to check for the installed package version on Debian. However, you must first install it on the Debian system from the following command:
Once the aptitude is successfully installed on your system, use the below-mentioned syntax command to get the version of the package.
Replace the package with the name of the package you want to check. I am using the aptitude command to check the version of the curl:
You can also install apt-show-versions command-line utility from the following command to check the version of the installed package on Debian.
Input the name of the package with the apt-show-versions command to get the list of available packages:
dpkg is the package manager for the Debian based Linux systems. The dpkg command with the grep and package name will provide the installed version of the package.
Knowing the package version before upgrading is important. We can also check the version of the installed package on Debian to confirm the installation. In this guide, we have explained the six different commands to check the version of the installed package on Debian. You can use those commands to check for the installed version of any package on Debian.