The only thing that you would have to change in the following is the name of the file (file0) and then the command to load the RPMs … they use up2date here but you could change out to “rpm -Uvh $line”.
My text file is just a list of packages (each package on a separate line).
#Check to make sure that the file containing the list of packages is present
if [ -f “$file0” ]; then
while read line
do up2date $line
done < “$file0”
echo -n “List of packages is not available, skipping package install”