PDA

View Full Version : [ubuntu] Rebuild .deb packages database



zmdmw52
September 14th, 2009, 12:38 PM
Is there a command (from the CLI) to rebuild the package database in Ubuntu - similar to the rpmdb --rebuilddb / rpm --rebuilddb for RPM-based systems (Fedora/openSUSE), as mentioned here (http://linuxpoison.blogspot.com/2007/10/repair-corrupt-rpm-database.html):
http://linuxpoison.blogspot.com/2007/10/repair-corrupt-rpm-database.html

or for openSUSE at this link (http://en.opensuse.org/SDB:Speed_up_Package_Manager_Stack#Defragment_inte rnally):
http://en.opensuse.org/SDB:Speed_up_Package_Manager_Stack#Defragment_inte rnally


First backup and then delete by doing the following command:
$ su
# cp /var/lib/rpm/__db.001 /home/nikesh
# rm /var/lib/rpm/__db.001
# cp /var/lib/rpm/__db.002 /home/nikesh
# rm /var/lib/rpm/ __db.002

# rpm –rebuilddb