apt-get system reinstallation
sktsee
sktsee at tulsaconnect.com
Thu Jul 10 16:02:18 UTC 2008
On Thu, 2008-07-10 at 08:51 -0400, Bart Silverstrim wrote:
> sktsee wrote:
>
> > Bart:
> > In answer to your question about package verification, use the md5sum
> > tool to check individual file integrity of installed packages.
> >
> > (must be run from "/")
> > $ md5sum -c /var/lib/dpkg/info/<packagename>.md5sums
> >
> > Of course, this won't cover self-packaged software or packages from
> > 3rd-party repos that don't include a md5sums file.
> >
>
> Seems to be a good way to do the verification! I was running this on the
> "firefox flash working" system to test (it has less software installed
> so wouldn't take as long), running in one terminal and getting:
> > sudo md5sum -c /var/lib/dpkg/info/*.md5sums > /home/bsilver/results.txt
> > [sudo] password for bsilver:
> > md5sum: WARNING: 9 of 1938 computed checksums did NOT match
> > md5sum: WARNING: 9 of 1938 computed checksums did NOT match
> > md5sum: WARNING: 9 of 1938 computed checksums did NOT match
> > md5sum: WARNING: 9 of 1938 computed checksums did NOT match
>
> I was guessing they're config files of some kind, but running
> > cat results.txt |grep -i " OK "
> (yes, I know this isn't as elegant as it could be...) yielded *no*
> results...so only the OK's are being redirected into results.txt?
No, results.txt should contain the output from md5sum. Just cat or open
the file with less to view. You didn't get results from the grep
command because there's no space after OK in the output, so your search
failed. Also, the -i means "ignore case". If you want to search for
lines that don't have " OK", then use the -v option. But its just easier
to just search for FAILED occurrences.
$ grep FAILED ~/results.txt
>
> I looked at the man page for md5sum and there's nothing I saw about only
> showing results that aren't OK. Stupid question, I know there's some way
> to do this with the shell, but is there a way to redirect the errors?
>
Sure, just redirect stderr to stdout.
:/ $ sudo md5sum -c /var/lib/dpkg/info/*.md5sums > /home/bsilver/results.txt 2>&1
The summary error messages like "md5sum: WARNING: 1 of 10 computed
checksums did NOT match" will appear after the list of files md5sum
processed for a particular <packagename>.md5sum file.
example:
$ sudo md5sum -c /var/lib/dpkg/info/zip.md5sums > ~/results.txt 2>&1
cat ~/results.txt
usr/share/doc/zip/copyright: OK
usr/share/doc/zip/CHANGES.gz: OK
usr/share/doc/zip/TODO: OK
usr/share/doc/zip/WHATSNEW: OK
usr/share/doc/zip/changelog.Debian.gz: OK
usr/share/man/man1/zip.1.gz: OK
usr/bin/zip: FAILED
usr/bin/zipnote: OK
usr/bin/zipsplit: OK
usr/bin/zipcloak: OK
md5sum: WARNING: 1 of 10 computed checksums did NOT match
--
sktsee
More information about the ubuntu-users
mailing list