许可证检查脚本: CheckLicense.sh

#!/bin/bash
# Author: hutuworm (http://hutuworm.blogspot.com)
# RELEASED UNDER GPLv2.

for PACKAGE in `rpm -qa`
do
NOTICE=`rpm -qi $PACKAGE | grep License | grep -iE 'red ?hat'`
if [ ! "$NOTICE" = "" ]
then
echo $PACKAGE ":" $NOTICE ;
fi
done

在装有 RHEL 的服务器上执行:

# sh CheckLicense.sh

redhat-logos-1.1.14.3-1 : Size : 993129 License: Copyright ?1999-2002 Red Hat, Inc. All rights reserved.

anaconda-p_w_picpaths-9.1-3.RHEL : Size : 5363878 License: Copyright ?2003 Red Hat, Inc. All rights reserved.

anaconda-product-3-1AS : Size : 75111 License: Copyright 2003 Red Hat, Inc. All rights reserved.

那么只需要把 redhat-logos-1.1.14.3-1、anaconda-p_w_picpaths-9.1-3.RHEL、anaconda-product-3-1AS 这三个 rpm 包用 rpm -e 命令从系统中移除,即可高枕无忧。