LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Rebuilding /var/lib/rpm/Packages (https://www.linuxquestions.org/questions/linux-software-2/rebuilding-var-lib-rpm-packages-762309/)

harris4got 10-16-2009 01:57 AM

Rebuilding /var/lib/rpm/Packages
 
Hello

I found my Fedora 10 system's "/var/lib/rpm/Packages" file got deleted. After running the "rpm --rebuilddb" command, it creates "Packages(12 KB in size) along with three __db.*" files but "rpm -qa" command is not showing any package list.

Is there any way to recreate the "/var/lib/rpm/Packages" from scratch without reinstalling the OS?..

Any help is appreciated.

Forrest Coredump 10-16-2009 08:25 PM

No sweat... Just re-initialize the database (actually build from scratch).

rpm -v --initdb

harris4got 10-18-2009 11:14 PM

Error on rpm -v --initdb
 
Thanx for the reply but this is what happens on rpm -v --initdb

Code:

# rpm -v --initdb
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30975) from dbenv->open: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 -  (-30975)


Forrest Coredump 10-22-2009 11:17 AM

I would blow away your existing db files;

[root@shell]# rm -f /var/lib/rpm/__db*

And rebuild the rpm database;

[root@shell]# rpm --rebuilddb

The above should do the trick...


All times are GMT -5. The time now is 11:38 PM.