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

Re: How can I check package integrity?



On Sun, 31 Aug 1997, Oliver Elphick wrote:

> Having recovered from a corrupt filesystem due to power failure - thanks
> to those who assisted - I still have a lot of files in lost+found.
> 
> Some of them obviously belong to packages like tetex, but I can't identify 
> others.  I would like to run through the list of installed packages
> and check every package to see whether all its files are present.  
> 
> Is there any tool to do this?

I recently did a check like this myself. I did:

cat /var/lib/dpkg/info/*.list | sort | /usr/local/bin/skipdouble > files.Debian
find /bin /boot /etc /lib /man /sbin /usr | sort | /usr/local/bin/skipdouble > files.Local
diff -u files.Debian files.Local > files.diff
grep ^+ files.diff > files.NotInDebian
grep ^- files.diff > files.NotInLocal

I then had these files:

files.Debian         contains all files installed by packages
files.Local          contains files actually there
files.diff           the difference between the two lists
files.NotInDebian    contains files not installed by packages
files.NotInLocal     contains missing files

/usr/local/bin/skipdouble is a shell script that filters out double lines
from stdin and echoes the rest on stdout. Obviously, it only works well
when its input is sorted.

#!/bin/sh

while read i
do
  if [ "X$i" != "X$j" ]
  then
    echo "$i"
    j="$i"
  fi
done

This system of file checking is not perfect or fool proof. You'll get all
files in /etc/rc?.d/, /etc/alternatives/ and others that are installed by
postinst scripts in the files.NotInDebian list, but if you want to take a
look at what is missing, this will help you a lot.

Remco
--
System Error, hit any user to continue



--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: