#!/bin/bash
#the package name is listed in the fc8-packages.txt
for LINE in `cat fc8-packages.txt`
do
rpm -qa | grep $LINE > /tmp/results.log
if [ `cat /tmp/results.log | wc -l` -eq 0 ]; then
echo "WARNING: $LINE is not found"
echo "now installing it....."
yum install $LINE
else
echo "$LINE is installed"
fi
donerm -rf /tmp/results.log
自动检查安装软件包
原创mb6603ea7fc8a1f 博主文章分类:Shell ©著作权
©著作权归作者所有:来自51CTO博客作者mb6603ea7fc8a1f的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Linux下怎样检查某软件包是否安装
Linux下怎样检查某软件包是否安装
Linux下怎样检查某软件包是否安装 -
安装vsftp软件包
安装vsftp软件包。
vsftp