#!/bin/bash

ALLPACKAGELIST=rpmallinstall_package.txt
BELONGED_PACKAGE_GROUPLIST=rpm_group.txt

if [ -f $BELONGED_PACKAGE_GROUPLIST ]
then
    rm -f $BELONGED_PACKAGE_GROUPLIST
fi

echo "get all packages start" 
rpm -qa > $ALLPACKAGELIST
echo "get all packages end" 
echo "get Group from rpm -qi" 
for xxx in `cat $ALLPACKAGELIST`
do
#    echo "---- $xxx ----" 
    rpm -qi $xxx | grep Group | awk '{print $3}' >> $BELONGED_PACKAGE_GROUPLIST
done

echo "-- Group List-- " 
sort $BELONGED_PACKAGE_GROUPLIST |uniq
最終更新:2012年07月08日 12:42