- for pkg in `rpm -qa | sort`; do echo -n "${pkg}: "; rpm --verify ${pkg} >/dev/null && echo OK || (echo "BROKEN" && echo -n "${pkg} " >> fix_reinstalls.txt); done; echo >> fix_reinstalls.txt # crude, I know, since it will wind up reinstalling even those RPMs whose configs have been changed, but as long as they handle that sanely, all's well...
- yum -y reinstall `cat fix_reinstalls.txt`