[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Package database corrupted



I've gotten mail from cron the last three days about bad lines in
/var/lib/dpkg/status on one of my machines; the first two times, I
opened it up in vi and corrected the illegal characters.  Today,
there was a second error:

---
/etc/cron.daily/dwww:
dpkg: parse error, in file `/var/lib/dpkg/status' near line 19804
package `crypt
++el':
 field name `Sectionº' must be followed by colon
/etc/cron.daily/standard:
print_command: bad command type: 1431634013
Stopping myself.../etc/cron.daily/standard: line 58:  8714 Aborted
savelog -c 7 dpkg.status >/dev/null
---

apt-get update (with testing, testing/non-US, and stable/updates in
sources.list) downloaded the package lists, then died with another
error (which I didn't preserve, but it appeared related to the
/var/lib/dpkg/status corruption) when it tried to merge the new
package lists.  I commented out the testing lines (so that it was
grabbing only the security updates) and it completed, but
/var/lib/dpkg/status still gives the same parse error.

As for the second error, `dpkg -S` (on another machine, since the
/var/lib/dpkg/status corruption prevents it from running on that box)
tells me that /etc/cron.daily/standard belongs to the cron package.
So I `apt-get install --reinstall cron` to fix it - and get a
segfault back.

And so I arrive at my three questions:

1)  What's likely to have scrambled /var/lib/dpkg/status?  I had a
Netscape-induced system crash a few days back (yes, Netscape managed
to get some of its processes wedged into uninterruptible sleep so
thoroughly that the system, though still accessible over the network,
was unable to shut down cleanly - never seen that happen before under
Linux and I hope to never see it again) and ended up having to fsck
everything manually, but I wouldn't expect to see that flipping
random bits in files that weren't even open at the time.

2)  Is there any way to automatically repair /var/lib/dpkg/status or
do I need to manually correct each bad character as it is reported to
me?

3)  Is the /var/lib/dpkg/status corruption sufficient cause for
apt-get to segfault, or can I expect that problem to persist even
after /var/lib/dpkg/status has been repaired?  If it does remain,
what's the easiest way to fix apt-get when apt-get doesn't work?

-- 
When we reduce our own liberties to stop terrorism, the terrorists
have already won. - reverius

Innocence is no protection when governments go bad. - Tom Swiss



Reply to: