Debian – How to find files in a Debian system not installed or created by dpkg

aptdebiandpkgfinduninstall

I've installed some things manually in the past and would like to weed out all related files. So, I need a way to automatically find all the files (in /usr, for example) that are not included in any of the packages currently installed on the Debian system. However, I would also need to filter out the files that are created during package installation (by dpkg post-install scripts and similar things).

Best Answer

Use the cruft package:

cruft is a program to look over the system for anything that shouldn't be there, but is; or for anything that should be there, but isn't.