Sometimes I want to know whether a file under /usr or /etc still looks like the package shipped it. dpkg can check that without extra tools.
dpkg --verify openssh-server
The man page says -V or --verify verifies the integrity of the named package, or of all packages if you leave the name out. The only functional check is an md5sum of the file contents. Only files that fail a check get a line.
A line starts with missing for a file that is gone, or with a code like ??5?????? in the default rpm-style format. A 5 in the third position means the digest check failed, so the content changed. A c before the path means the file is a conffile, which is the normal reason for a hit: you edited /etc/ssh/sshd_config on purpose. Run it for one package to keep the list readable.
The format is selectable with --verify-format, and the docs warn that the default may change in the future, so don’t parse it in a script you want to keep.
There are two caveats from the docs. A file is only checked if the database holds its md5sum, so missing metadata means a missing check. dpkg --audit is the documented way to look for missing metadata. And the page says it is only an integrity check and should not be considered any kind of security verification: I read that as: whoever can change a file may be able to change the stored sums too. Running it on a whole system can be noisy: on a minimized install, where docs and man pages were removed, those files show up as missing.
Further reading: dpkg(1): –verify