.ds Dt \\$4 .TH DEBSUMS 1 \*(Dt Debian "User Commands" .SH NAME debsums \- check the MD5 sums of installed Debian packages .SH SYNOPSIS .B debsums .RI [ options ] .RI [ package | deb ] \&... .SH DESCRIPTION Verify installed Debian package files against MD5 checksum lists from /var/lib/dpkg/info/*.md5sums. .PP .B debsums can generate checksum lists from deb archives for packages that don't include one. .SH OPTIONS .TP .BR \-a ", " \-\-all Also check configuration files (normally excluded). .TP .BR \-e ", " \-\-config \fBOnly\fR check configuration files. .TP .BR \-c ", " \-\-changed Report changed file list to stdout (implies .BR \-s ). .TP .BR \-l ", " \-\-list\-missing List packages (or debs) which don't have an MD5 sums file. .TP .BR \-s ", " \-\-silent Only report errors. .TP .BR \-m ", " \-\-md5sums =\fIfile Read list of deb checksums from .IR file . .TP .BR \-r ", " \-\-root =\fIdir Root directory to check (default /). .TP .BR \-d ", " \-\-admindir =\fIdir dpkg admin directory (default /var/lib/dpkg). .TP .BR \-p ", " \-\-deb\-path =\fIdir\fR[:\fIdir\fR...] Directories in which to look for debs derived from the package name (default is the current directory). .IP A useful value is /var/cache/apt/archives when using .B "apt\-get autoclean" or not clearing the cache at all. The command: .RS .IP apt\-get \-\-reinstall \-d install \`debsums \-l\` .RE .IP may be used to populate the cache with any debs not already in the cache. .IP .B Note: This doesn't work for CD-ROM and other local sources as packages are not copied to /var/cache. Simple .B file sources (all debs in a single directory) should be added to the .B \-p list. .TP .BR \-g ", " \-\-generate =[ missing | all ][, keep [, nocheck ]] Generate MD5 sums from deb contents. If the argument is a package name rather than a deb archive, the program will look for a deb named .IR package _ version _ arch .deb in the directories given by the .B \-p option. .RS .TP .B missing Generate MD5 sums from the deb for packages which don't provide one. .TP .B all Ignore the on disk sums and use the one supplied in the deb, or generated from it if none exists. .TP .B keep Write the extracted/generated sums to .RI /var/lib/dpkg/info/ package .md5sums. .TP .B nocheck Implies .BR keep ; the extracted/generated sums are not checked against the installed package. .RE .IP For backward compatibility, the short option .B \-g is equivalent to .BR \-\-generate=missing . .TP .BR \-\-no\-locale\-purge Report missing locale files even if localepurge is configured. .TP .BR \-\-no\-prelink Report changed ELF files even if prelink is configured. .TP .BR \-\-ignore\-permissions Treat permission errors as warnings when running as non-root. .TP .BR \-\-ignore\-obsolete Ignore obsolete conffiles. .TP .B \-\-help .PD 0 .TP .B \-\-version .PD Print help and version information. .SH EXIT STATUS .B debsums returns .B 0 on success, or a combination* of the following values on error: .TP .B 1 A specified package or archive name was not installed, invalid or the installed version did not match the given archive. .TP .B 2 Changed or missing package files, or checksum mismatch on an archive. .TP .B 255 Invalid option. .PP *If both of the first two conditions are true, the exit status will be .BR 3 . .SH EXAMPLES .TP debsums foo bar Check the sums for installed packages .B foo and .BR bar . .TP debsums foo.deb bar.deb As above, using checksums from (or generated from) the archives. .TP debsums \-l List installed packages with no checksums. .TP debsums \-ca List changed package files from all installed packages with checksums. .TP debsums \-ce List changed configuration files. .TP debsums \-cagp /var/cache/apt/archives As above, using sums from cached debs where available. .TP apt-get install \-\-reinstall $(dpkg \-S $(debsums \-c) | cut \-d : \-f 1 | sort \-u) Reinstalls packages with changed files. .SH RESULTS .TP OK The file's MD5 sum is good. .TP FAILED The file's MD5 sum does not match. .TP REPLACED The file has been replaced by a file from a different package. .SH SEE ALSO .BR md5sum (1), .SH ENVIRONMENT .TP .B TMPDIR Directory for extracting information and contents from package archives (/tmp by default). .SH CAVEATS While in general the program may be run as a normal user, some packages contain files which are not globally readable so cannot be checked. Privileges are of course also required when generating sums with the .B keep option set. .PP Files which have been replaced by another package may be erroneously reported as changed. .PP .B debsums is intended primarily as a way of determining what installed files have been locally modified by the administrator or damaged by media errors and is of limited use as a security tool. .PP If you are looking for an integrity checker that can run from safe media, do integrity checks on checksum databases and can be easily configured to run periodically to warn the admin of changes see other tools such as: .BR aide , .BR integrit , .BR samhain , or .BR tripwire . .SH AUTHOR Written by Brendan O'Dea . .br Based on a program by Christoph Lameter and Petr Cech . .SH COPYRIGHT Copyright \(co 2002 Brendan O'Dea .br This is free software, licensed under the terms of the GNU General Public License. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.