Bug 71683 - Can't rebuild packages list (/var/lib/rpm).
Can't rebuild packages list (/var/lib/rpm).
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
7.1
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-08-16 13:10 EDT by David Evans
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-08-16 13:10:43 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description David Evans 2002-08-16 13:10:39 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; T312461)

Description of problem:
At some point the /var/lib/rpm directory disappeared. I am not sure how it 
happened since the last change to system was done through up2date. I was told I 
could rebuild it with the following commands:

rpm --initdb
rpm -- rebuilddb

These only seem to work if the rpm directory is recreated. However, they pretty 
much built an empty packages list. The technician told me to submit a bug 
report since the behavior is not as expected. If you would like to see the 
ticket, it is number 211289.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Delete or move the /var/lib/rpm directory
2. cd /var/lib
3. mkdir rpm
4. rpm --initdb
5. rpm --rebuilddb

Additional info:
Comment 1 Jeff Johnson 2002-08-17 12:44:24 EDT
Yes. If /var/lib/rpm is entirely gone, then
--initdb and --rebuilddb can/will not recreate
the original contents.

Look in /var/log/rpmpkgs for the list of packages
that were installed on your system. Reinstall
those packages to recreate the database. Or, even
simpler, reinstall using anaconda to recreate
your database.
Comment 2 David Evans 2002-08-21 18:04:05 EDT
OK. All of the rpmpkgs log files have the error:

error: cannot open Packages index using db3 - No 
such file or directory (2)

However, the redhat network site still contains an updated 
package list. I am a little nervous about running anaconda since I have run up2date a couple of 
times since the system was installed. (In fact, I am still not convinced that up2date was not the 
culprit that wiped the rpm directory.) Is there a way I could push the package list down from the 
redhat network?
Comment 3 Jeff Johnson 2002-08-21 20:52:50 EDT
If all the rpmpkgs file have the error, then
/var/lib/rpm has been gone for a while.

Look at the file modify times to get an idea
how long /var/lib/rpm has been missing.

Anaconda (followed by running up2date) is
the easiest way to recreate the database.

If you thing up2date is the culprit (I don't FWIW),
then use the --download option, and install the
packages from /var/spool/up2date using rpm from
the command line. If you don't trust up2date even
that much, download and install the updates manually.

You can also get the package list by logging into
rhn.redhat.com and displaying the installed package list.
Comment 4 David Evans 2002-08-22 17:29:19 EDT
I am not sure if I am not abusing the system but it never hurts to ask. I tried 
to use anaconda --reconfig but it never loads/unloads packages. If I use 
anaconda --method cdrom:///mnt/cdrom it tells me I am stupid for running it on 
a live system. It seems as though I have to entirely reinstall to rebuild the 
packages using anaconda. Was there some other mode that you were thinking about?
Comment 5 Jeff Johnson 2002-08-22 17:33:15 EDT
Do a reinstall using anaconda, but do not
make a new file system on your disk partitions.

That's the easiest way to recreate the database
without losing any data.
Comment 6 David Evans 2002-08-27 12:21:12 EDT
I just wanted to thank you for your help, jbj@redhat.com. I ended up using the list of packages 
stored in the redhat network to create some shell scripts to reinstall the packages. Once the rpm 
database was rebuilt, I was able to run up2date with no problems. Thanks again.

Note You need to log in before you can comment on or make changes to this bug.