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.
Download this article as ad-free PDF (made possible by your kind donation): 
Download PDF

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.

Support Xmodulo

Did you find this tutorial helpful? Then please be generous and support Xmodulo!

Leave a comment

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