Linux – How to Find Files Created by an Installer (RPM, DEB)

auditfilesystemsinotifylinuxSecurity

I need to find out all the file system modifications an installer did. Most likely the installed package is an rpm or deb, but an app could of course be simply copied over or compiled and installed with the configure;make;make install way. Even though rpm and deb have file lists, their post install scripts could do additional file system modifications.

I first went looking for an application that could monitor another application to find all file system modifications the other app did. I haven't found any.

Next I looked into layered file systems, thinking before I started the app install I'd put in a layered file system and then install the app on the layered file system, and then find out all the modifications that happened in the layer. The best I could find was mini_fo but it seems it hasn't been maintained since 2006. It also does not seem like it could just be overlaid on / (this hides some stuff from the layer).

Then I looked into inotify-based solutions, but it seems like it is impractical for monitoring everything starting from /. For example, inotifywatch (linux.die.net/man/1/inotifywatch) mentions by default the limit of watches is just 8k. It also takes some time to install the watchers. There also appear to be bugs, where newly created directories are not immediately watched so changes in them can be missed.

Apart from taking snapshots from the file system before and after installation and comparing, is there any other way of achieving what I want to do?

Best Answer

I would be tempted to try running your install via strace. It will be a bit noisy, but you among all the other things it logs, you should be able to see should see everything that gets written.

Here is a command that seemed to get close to showing all file accesses during an installation without too much noise.

sudo strace -o /tmp/install.log -f -e trace=file apt-get install package
Related Topic