Author Topic: How to repair a corrupted RPM database  (Read 9518 times)

Offline Texstar

  • Administrator
  • Super Villain
  • *****
  • Posts: 12536
How to repair a corrupted RPM database
« on: October 08, 2010, 11:10:26 AM »
How to repair the Synaptic RPM database

Open a Terminal Konsole
Type su and press the enter/return key
type in your root password (hidden) press the enter/return key

Remove corrupted database:
[root@localhost ~]# rm -rf /var/lib/rpm/__db*

Rebuild RPM database: (This can take a while. Let it finish!)
[root@localhost ~]# rpm --rebuilddb

Check for duplicate installed packages:
[root@localhost ~]# dupeclean

Clean out apt
[root@localhost ~]# apt-get clean
[root@localhost ~]# apt-get autoclean

Type exit
Type exit

« Last Edit: October 08, 2010, 01:48:22 PM by Texstar »

Thanks to everyone who donates. You keep the servers running.

Offline Duvid

  • Sr. Member
  • ****
  • Posts: 270
Re: How to repair a corrupted RPM database
« Reply #1 on: June 10, 2011, 08:44:35 PM »
After doing a clean install of kde pclos 2012.12 updating sources list then reloading, I wind up with a corrupted database. I have rebuilt it exactly as you have posted, which then allowed me to download the approx 500 packages. As soon as it attempts to apply the packages the system crashes or freezes. When I go to reboot the system the xorg system is corrupted. Some tinkering around has got me prompted for task-X11 packages which I could not do when the system was borked again. I have duplicated this scenario at least a dozen times, trying remastered cd from other computers on dvd or external drives,
 The computer will work fine for days without updating. Installed apps,Firefox, vlc etc. all function fine with the native installs found on the 2010.12 iso or what are found on the remasters.
 None of the disks used have given me any problems on any other computer which is most puzzling. I have changed out the hard drive, memory, video card, removed cpu and reapplied thermal grease. All the temps  are as they should be. When rebuilding the database everything is looking good until the end which I am posting.

Computer Specs  Athlon 6000 X2   Nvidia 8400GT 2gig memory  Nvidia chipset

 D: closed   db index       /var/lib/rpmrebuilddb.7307/Filedigests
rpmdb: Page 534: item 71 has bad type
rpmdb: /var/lib/rpmrebuilddb.7307/Filedigests: DB_VERIFY_BAD: Database verification failed
error: db4 error(-30972) from db->verify: DB_VERIFY_BAD: Database verification failed
D: verified db index       /var/lib/rpmrebuilddb.7307/Filedigests
D: closed   db index       /var/lib/rpmrebuilddb.7307/Sha1header
D: verified db index       /var/lib/rpmrebuilddb.7307/Sha1header
D: closed   db index       /var/lib/rpmrebuilddb.7307/Sigmd5
D: verified db index       /var/lib/rpmrebuilddb.7307/Sigmd5
D: closed   db index       /var/lib/rpmrebuilddb.7307/Installtid
D: verified db index       /var/lib/rpmrebuilddb.7307/Installtid
D: closed   db index       /var/lib/rpmrebuilddb.7307/Provideversion
D: verified db index       /var/lib/rpmrebuilddb.7307/Provideversion
D: closed   db index       /var/lib/rpmrebuilddb.7307/Requireversion
D: verified db index       /var/lib/rpmrebuilddb.7307/Requireversion
D: closed   db index       /var/lib/rpmrebuilddb.7307/Dirnames
rpmdb: Page 147: gap between items at offset 3992
rpmdb: Page 147: gap between items at offset 4088
rpmdb: Page 147: item order check unsafe: skipping
rpmdb: /var/lib/rpmrebuilddb.7307/Dirnames: DB_VERIFY_BAD: Database verification failed
error: db4 error(-30972) from db->verify: DB_VERIFY_BAD: Database verification failed
D: verified db index       /var/lib/rpmrebuilddb.7307/Dirnames
D: closed   db index       /var/lib/rpmrebuilddb.7307/Triggername
D: verified db index       /var/lib/rpmrebuilddb.7307/Triggername
D: closed   db index       /var/lib/rpmrebuilddb.7307/Conflictname
D: verified db index       /var/lib/rpmrebuilddb.7307/Conflictname
D: closed   db index       /var/lib/rpmrebuilddb.7307/Providename
D: verified db index       /var/lib/rpmrebuilddb.7307/Providename
D: closed   db index       /var/lib/rpmrebuilddb.7307/Requirename
D: verified db index       /var/lib/rpmrebuilddb.7307/Requirename
D: closed   db index       /var/lib/rpmrebuilddb.7307/Group
D: verified db index       /var/lib/rpmrebuilddb.7307/Group
D: closed   db index       /var/lib/rpmrebuilddb.7307/Basenames
rpmdb: Page 172: item 69 has bad type
rpmdb: /var/lib/rpmrebuilddb.7307/Basenames: DB_VERIFY_BAD: Database verification failed
error: db4 error(-30972) from db->verify: DB_VERIFY_BAD: Database verification failed
D: verified db index       /var/lib/rpmrebuilddb.7307/Basenames
D: closed   db index       /var/lib/rpmrebuilddb.7307/Name
D: verified db index       /var/lib/rpmrebuilddb.7307/Name
D: closed   db index       /var/lib/rpmrebuilddb.7307/Packages
D: closed   db environment /var/lib/rpmrebuilddb.7307/Packages
D: verified db index       /var/lib/rpmrebuilddb.7307/Packages
D: removing directory /var/lib/rpmrebuilddb.7307

Offline Texstar

  • Administrator
  • Super Villain
  • *****
  • Posts: 12536
Re: How to repair a corrupted RPM database
« Reply #2 on: June 10, 2011, 09:36:21 PM »
Your installation CD has become corrupted/faulty or your CD drive has lost the ability to properly read the compressed image of the LiveCD.

Thanks to everyone who donates. You keep the servers running.

Offline Duvid

  • Sr. Member
  • ****
  • Posts: 270
Re: How to repair a corrupted RPM database
« Reply #3 on: June 10, 2011, 10:19:11 PM »
Thanks for the quick reply, but what baffles me is that the live cd sources are made in several other computers, when installed have functioned fine for days. Several of the installs were from live usb made from a totally independent source/machine which have all been production machines.
 I have concluded there is a problem with this new computer, but can't figure out what it may be. Forgot to mention the remastered disk has Linux 2.6.38.2-pclos1.bfs i686  Linux 2.6.38.2-pclos1.bfs i686 which is the machine I am posting from. I guess I am hoping there is an intereaction with pclos that can be tweaked before I kick this new computer out the window and hit my neighbor in the head. Hoping there is help for this almost large paperweight!

Offline Texstar

  • Administrator
  • Super Villain
  • *****
  • Posts: 12536
Re: How to repair a corrupted RPM database
« Reply #4 on: June 11, 2011, 12:38:52 AM »
Thanks for the quick reply, but what baffles me is that the live cd sources are made in several other computers, when installed have functioned fine for days. Several of the installs were from live usb made from a totally independent source/machine which have all been production machines.
 I have concluded there is a problem with this new computer, but can't figure out what it may be. Forgot to mention the remastered disk has Linux 2.6.38.2-pclos1.bfs i686  Linux 2.6.38.2-pclos1.bfs i686 which is the machine I am posting from. I guess I am hoping there is an intereaction with pclos that can be tweaked before I kick this new computer out the window and hit my neighbor in the head. Hoping there is help for this almost large paperweight!

remove /var/lib/rpm then try to copy /var/lib/rpm from the livecd to the hardrive

Thanks to everyone who donates. You keep the servers running.

Offline edge226

  • New Friend
  • *
  • Posts: 3
Re: How to repair a corrupted RPM database
« Reply #5 on: February 06, 2012, 10:50:27 PM »

 None of the disks used have given me any problems on any other computer which is most puzzling. I have changed out the hard drive, memory, video card, removed cpu and reapplied thermal grease. All the temps  are as they should be. When rebuilding the database everything is looking good until the end which I am posting.


The most likely cases of having hardware issues if you have checked the memory is usually the power supply or the motherboard.

Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3747
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: How to repair a corrupted RPM database
« Reply #6 on: April 22, 2012, 08:05:07 AM »
same package twice installed

Code: [Select]
This package won't be cleanly updated, unless you leave
only one version. To leave multiple versions installed,
you may remove that warning by setting the following
option in your configuration file:

and the tip in top of the topic wont help
so try, to find out was is installed

Code: [Select]
rpm -qa | grep package_name
then

Code: [Select]
rpm -e  package-version-release --allmatches
If package required by other, so add it as follow

Code: [Select]
rpm -e  packagename package-version-release --allmatches
-l