On Thu, Apr 03, 2003 at 09:41:01AM -0800, Michael K O'Brien wrote: > Hola~ > > The motherboard on my Dell Inspiron 8000 died, and was replaced. After fsck Avoid Dell IMHO... > cleaned up the drive, dpkg was failing: > > % dpkg -l g++\* > dpkg-query: failed to open package info file `/var/lib/dpkg/status' for > reading: No such file or directory > > A version of it was in lost+found. I moved the version from lost+found back to > "/var/lib/dpkg/status". dpkg lists packages now. apt-cache update looks like > it works. Hm. Sounds like the directory /var/lib/dpkg got corrupted somehow. Bad sign. What about other stuff under /var/lib/dpkg? Especially /var/lib/dpkg/info, since that contains the install/remove scripts for each package. That's worth worrying about too... > I guess I'm a bit nervous of the integrity of the status file. Is there any > way to verify the status file? I don't know of any way of verifying it for certain, but there are a couple of ways of building confidence in that it is correct: - if dpkg doesn't complain, odds are that it is not corrupted. Definitely a good sign. Whether it is *correct* is a slightly different matter. - Compare with the backup files : /var/backups/dpkg.status.* - AFAIK dpkg makes backups whenever you install/remove things (somebody is bound to know exactly when - please shout!). A simple diff between them should then only show differences for packages recently installed/removed/upgraded. - Every installed package *should* end up creating a directory under /usr/share/doc (or /usr/doc for older packages; not sure what qualifies as "old here"). If you have directories under /usr[/share]/doc that do not match the name of an installed package, then something is inconsistent. IIRC there are a couple of exceptions to this rule, mainly consisting of directories that start with an upper case letter - they won't correspond to packages. Apart from this there is always google: a google search on "recover /var/lib/dpkg" brings up a couple of interesting links, amongst other things (surprise!): http://www.debian.org/doc/manuals/quick-reference/ch-package.en.html A couple of months back there was a (short?) discussion in one of the debian lists on how to recover a fully hosed /var - that's bound to be in the archives/google somewhere. HTH -- Karl E. Jørgensen karl@jorgensen.com http://karl.jorgensen.com ==== Today's fortune: A real diplomat is one who can cut his neighbor's throat without having his neighbour notice it. -- Trygve Lie
Attachment:
pgploP2LYWE_G.pgp
Description: PGP signature