#!/bin/sh # $Id: centos-rpmcheck,v 1.2 2006/06/09 15:00:46 ajr Exp $ # # Script: centos-rpmcheck # # Description: Check installed RPMs against a list of official CentOS # RPMs and report mismatched or missing versions. # Used to verify a Fedora -> CentOS upgrade. # NB. Packages could be missing because they're not provided # by CentOS; you need to verify the output manually. # Close matches probably require forced update manually. # # URL: http://www.big-bubbles.fluff.org/ # # History: # 2006-06-07: Created - ajr # # this file should contain a plain listing of the RPMS directory on the # CentOS installation disk(s), and should be in the current dir: cdfile="centos-rpms.ls" rpm -qa | sort | while read rpm; do grep -q ${rpm} ${cdfile} if [ $? -eq 0 ]; then # RPM matches one from CentOS echo "${rpm}: installed OK" continue fi pkgname="`echo ${rpm} | sed -e 's/\-[0-9].*//'`" matches="`egrep \^${pkgname} ${cdfile}`" if [ "${matches}" = '' ]; then # no such package in CentOS echo "${rpm}: no matches" else # similar packages with different names or versions echo "${rpm} approx matches: ${matches}" echo fi done