6.3.4 Recover package selection data
If /var/lib/dpkg/status
becomes corrupt for any reason, the Debian
system loses package selection data and suffers severely. Look for the old
/var/lib/dpkg/status
file at /var/lib/dpkg/status-old
or /var/backups/dpkg.status.*
.
Keeping /var/backups/
in a separate partition may be a good idea
since this directory contains lots of important system data.
If no old /var/lib/dpkg/status
file is available, you can still
recover information from directories in /usr/share/doc/
.
# ls /usr/share/doc | \
grep -v [A-Z] | \
grep -v '^texmf$' | \
grep -v '^debian$' | \
awk '{print $1 " install"}' | \
dpkg --set-selections
# dselect --expert # reinstall system, de-select as needed