Jaime Frutos Morales's blog

02/03/2010

How to rebuild a corrupted RPM database in Red Hat Linux

Filed under: Linux, SysAdmin — acidborg @ 18:42

Description: If your system’s RPM database is corrupted, you can try this short recipe to rebuild it before trying to restore it from a backup (NOTE: don’t forget to make a backup of the /var/lib/rpm directory periodically on every Red Hat Linux system!).

Steps:

  1. Remove RPM’s locks (if present): rm -f /var/lib/rpm/__db*
  2. Rebuild RPM’s database: rpm -vv --rebuilddb
  3. Check if it worked: yum update

If this didn’t work, then restore from your backup.

Advertisements

Blog at WordPress.com.

%d bloggers like this: