I need to check for installed packages and if not installed install them.
Example for RHEL, CentOS, Fedora:
rpm -qa | grep glibc-static glibc-static-2.1
If you are doing this against downloaded RPMs. you can do it by.
rpm -Uvh package-name-version-tag.rpm