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

Re: broken dpkg status



On Thu, Jul 14, 2011 at 11:44 +0100, Tony van der Hoff wrote:
> Due to a combination of fiddling and finger-trouble I have contrived
> to delete part of my /var partition. Unfortunately, I have never
> thought to back up /var, being transient data... Big mistake!
> 
> Anyway, the most pressing problem at the moment is that apt fails,
> due to missing status data:
> 
> E: Could not open file /var/lib/dpkg/status - open (2: No such file
> or directory)
> E: The package lists or status file could not be parsed or opened.
> 
> How do I recover from this?

Uh, tough one. You can try the following which relies on the fact that every
package install documentation in /usr/share/doc/PKG and will reinstall all
those packages:

    find /usr/share/doc -maxdepth 1 -mindepth 1 -type d -not -name texmf  \
    -not-name debian -printf 'install %f\n' \
    | xargs aptitude --schedule-only reinstall; aptitude install;;

Unfortunately that also means that the information about
automatically/manually installed packages is lost.

There are certainlt other ways, but I like this one. I will think about how
you could get the manually/automatically installed information back.

-- 
  .''`.     Wolodja Wentland    <babilen@gmail.com>
 : :'  :
 `. `'`     4096R/CAF14EFC
   `-       081C B7CD FF04 2BA9 94EA  36B2 8B7F 7D30 CAF1 4EFC

Attachment: signature.asc
Description: Digital signature


Reply to: