title: How can I fix this corrupted rpmdb?
body: <p>My rpmdb is corrupted, and the usual procedure for fixing it doesn't seem to work.</p>
  
  <p>This is the error:</p>
  
  <pre><code>cris@PolariSuse [~]$ rpm -qa &gt; /dev/null
  error: rpmdbNextIterator: skipping h#   64697
  Header V3 RSA/SHA256 Signature, key ID 3dbdc284: BAD
  Header SHA1 digest: BAD (Expected bf167126ecaa67d16fee74af17096529278aad8d != cd4a91ad1f0d65d360cce5dacffea553e358b550)
  </code></pre>
  
  <p>If I try to fix it I get this:</p>
  
  <pre><code>cris@PolariSuse [~]$ sudo rpmdb --rebuilddb
  [sudo] password for root:
  error: cannot add record originally at 64697
  warning: failed to rebuild database: original database remains in place
  </code></pre>
  
  <p>I even tried <em>db_dump</em> against the Packages file and subsequent <em>db_load</em>: it apparently works but the newly produced Packages file has the same error.</p>
  
  <p>However, I see that after rpm gets the error while listing packages, it is nonetheless able to continue listing the subsequent packages, so ideally I would like to rebuild the Packages file skipping the corrupted record.
  Unfortunately I have not found any utility capable of doing it.</p>
  
  <p>Does anybody know another way of fixing this corrupted db?</p>