Check if package is installed in linux

Posted . Visible to the public.

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
Sandheep
Posted by Sandheep to Sandheep's deck (2013-05-03 14:17)