Skip to content

Instantly share code, notes, and snippets.

@sandheepg
Created March 8, 2017 07:23
Show Gist options
  • Save sandheepg/ca7e6d8c7115abce9180bb24e4fbf0a9 to your computer and use it in GitHub Desktop.
Save sandheepg/ca7e6d8c7115abce9180bb24e4fbf0a9 to your computer and use it in GitHub Desktop.
Check if a package is installed in linux

To check if a given package is installed in Debian / Ubuntu, type

dpkg -s <package-name>

To get a neater output use dpkg-query which accepts wildcards as well.

dpkg-query -l <package-name>

In Redhat / Fedora / CentOS use the following command

rpm -qa | grep <package-name> # no output, package not installed

# to display list of all installed packages
rpm -qa
rpm -qa | less
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment