title: Checking for installed packages and if not found install
body: <p>I need to check for installed packages and if not installed install them. </p>
  
  <p>Example for RHEL, CentOS, Fedora:</p>
  
  <pre><code>rpm -qa | grep glibc-static
  glibc-static-2.12-1.80.el6_3.5.i686
  </code></pre>
  
  <p>How do I do a check in BASH?</p>
  
  <p>Do I do something like?</p>
  
  <pre><code>if [ "$(rpm -qa | grep glibc-static)" != "" ] ; then
  </code></pre>
  
  <p>And what do I need to use for other distributions? apt-get?</p>