Is there a good way to use Yum to test if something is installed (true of false) and then use that answer in a Bash script?
|
feedback
|
|
It's faster to query using
| |||||
feedback
|
|
if you know a bit of python you could do it very easy - yum has pre/post filters that can be enabled you can even make your own plugin. from shell just look for any lines that will be the output from your query. pack = yum info package | wc -l if [ "$pack" != '' ]; then
else
fi | |||
|
feedback
|
|
I typically test for the results of the package, usually a file on the file-system that is installed. Something like:
This requires no RPM database lookup, so it's very light-weight. | |||
|
feedback
|