If you want to keep for example a build or server system clean, it is very useful to be able to check that all files are present and accounted for by the package metadata. At work we have a very nice tool which, if run without any parameters, simply creates a file with rm/rmdir statements for any and all files/directories not mentioned by any package (excluding some trees like /home). This is different from rpm -V and debsums, which only check the files already mentioned by a package.Is there a tool like this for DEB/RPM/Ports/other packaging systems? DEB would be the best, but porting from another system (or our own, if nothing else exists) would probably be feasible.PS: I am not looking for alternative architectures. The issue here is to have absolutely every file on the system accounted for. VMs and such are not applicable.
Tool to remove all non-package files on a system
security;verification;checksum;files
If what you want is a file integrity checker, then RPM will do what you want. rpm -qaV(note the uppercase V). That will go through and check:file sizemode(permission and file type)MD5 checksumdevice number(checks if someone's hiding a file by mounting another partition therereadlink path(if the symlink points to a different file)user ownershipgroup ownershipmodification timeThat should be a fairly comprehensive list.rpm -qa --filesbypkg | awk '{print $2}' will list all the files on the system that have been accounted for.find / | grep -vf /tmp/files-on-system.txt will find all files on the system that are not in the RPM database. Another way of accomplishing these two commands in one command would be rpm -qf 'find /'#replace single quote with backtick NOTE: This will also flag as erroneous files in directories like/dev/home/proc/var/run/var/log/var/lib/tmp