RPM Freshen Utility

Here's a small shell script I wrote that will re-install all RPM files on a RedHat or Linux Mandrake system. This is useful in case an installation gets corrupted, but the package list is still intact (i.e., a malicious user deletes the /usr hierarchy). You can download the source from here.
#!/bin/sh

for i in `rpm -q -a`; do
  if [ -f $i.noarch.rpm ]; then
    rpm -Uvh --force --nodeps $i.noarch.rpm
  fi
  if [ -f $i.i686.rpm ]; then
    rpm -Uvh --force --nodeps $i.i686.rpm
  fi
  if [ -f $i.i586.rpm ]; then
    rpm -Uvh --force --nodeps $i.i586.rpm
  fi
  if [ -f $i.i486.rpm ]; then
    rpm -Uvh --force --nodeps $i.i486.rpm
  fi
  if [ -f $i.i386.rpm ]; then
    rpm -Uvh --force --nodeps $i.i386.rpm
  fi
done


This page created by Paul Brannan
Last modified: Friday, 22-Feb-2002 10:04:22 EST
URL: http://hubcap.clemson.edu/~cout/hubcap/rpmfreshen.html