How to check if .deb package is installed

Question: How can I check whether or not a particular .deb package is installed on Debian or Ubuntu?

If you want to check if a particular Debian package is installed on your system, you can use dpkg command with "-s" option, which returns the status of a specified package. Use the following command line to find out whether or not a .deb package is installed.

$ dpkg -s <package-name> |  grep Status

For example, to check if tcpdump package is installed:

$ dpkg -s tcpdump | grep Status
Status: install ok installed

If a package is not installed, you will see the following message.

$ dpkg -s tomcat6 | grep Status
dpkg-query: package 'tomcat6' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.

Subscribe to Ask Xmodulo

Do you want to receive Linux related questions & answers published at Ask Xmodulo? Enter your email address below, and we will deliver our Linux Q&A straight to your email box, for free. Delivery powered by Google Feedburner.

Leave a comment

Your email address will not be published. Required fields are marked *

Current day month ye@r *