How to check if .deb package is installed

Last updated on July 12, 2020 by Dan Nanni

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.

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal or credit card

Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.

Xmodulo © 2021 ‒ AboutWrite for UsFeed ‒ Powered by DigitalOcean