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

Re: Repairing a corrupted system



also sprach Martin McCormick <martin@dc.cis.okstate.edu> [2005.02.10.1532 +0100]:
> 	I killed my home system last Saturday when a shell script I
> was using to shred old files on a backup hard drive followed a link
> and ate part of /lib which is an extremely bad thing to do.

As long is it's not /var:

  dpkg --get-selections | sed -ne 's,install$,,p' | \
    xargs apt-get install --reinstall --yes

This will simply reinstall all packages that dpkg has installed in
the past, which should put /lib back into place. Maybe

  dpkg -S /lib | cut -d: -f1 | tr , \\n | \
    xargs apt-get install --reinstall --yes

is enough as it only reinstalls the packages which put files into
/lib.

Afterwards, clean out /lib:

  for file in /lib/*; do
    dpkg -S $file || mv $file $file.not-needed
  done

and delete all *.not-needed files as soon as everything is working.

-- 
Please do not send copies of list mail to me; I read the list!
 
 .''`.     martin f. krafft <madduck@debian.org>
: :'  :    proud Debian developer, admin, user, and author
`. `'`
  `-  Debian - when you have better things to do than fixing a system
 
Invalid/expired PGP subkeys? Use subkeys.pgp.net as keyserver!

Attachment: signature.asc
Description: Digital signature


Reply to: