Thursday 25 October 2012

Checking if a package or rpm is installed on CentOS, Fedora, or Redhat system

4.55pm. Another quick post, I wanted to find out if a package was already installed on a Fedora system, at first I though I could use:
yum search PackageName
However this only told me that it was available in the yum repositories, not if it was installed. Instead I wanted:
rpm -qa|grep PackageName 
The "rpm -qa" command queries the local package manager database and outputs every package you have installed (including yum installs). I then pipe it to grep along with a search term.

The end result tells me what packages and versions are installed on that system, and if I need to run the following command or not:
yum install PackageName