3

I need to install some proprietary package from some vendor (i.e. nvidia, cisco, ...). I have some binary installation file which copy files to my filesystem during installation (to /usr/share/, /etc/, /usr/bin/, ...). But I don't know what and where exactly. When I want to install this APP there is not uninstall binary file and there could be problem with removing files of APP.

Is in Linux some tool(s) which can track where files are copied?

I would like to find some general solution without dependence on Linux distribution. My vision is something like track ./install.bin and output will be files which were manipulated.

On system I don't have tools like locate.

7
  • Please let us know which Linux distribution you have so that we know which package manager you use. Commented Mar 28, 2018 at 10:07
  • 1
    Why not use find? With POSIX compliant options, you could use it in all distros Commented Mar 28, 2018 at 10:08
  • @Inian You are right and had the same idea as me, was typing the answer and did not see your comment. Commented Mar 28, 2018 at 10:21
  • I'm using Arch Linux but I would like to have some solution independent on Linux distribution. Commented Mar 28, 2018 at 10:40
  • For the record, this was also on Stack Overflow but is closed now: stackoverflow.com/questions/49530061/… Commented Mar 28, 2018 at 13:42

3 Answers 3

5

Simplest way: find.

The easiest method (easiest meaning, no extra tools to install, easy to type in) would be to save a list of all files before and after the install, then compare the lists.

You could type

find / -xdev \( -name home -o -name mnt -o -name proc -o -name dev -o -name sys \) -prune -o -print | sort > /root/files-before-install 

Then install your program and

find / -xdev \( -name home -o -name mnt -o -name proc -o -name dev -o -name sys \) -prune -o -print | sort > /root/files-after-install 

(please note the other file name at the end)

Afterwards you can compare the files like this:

diff /root/files-before-install /root/files-after-install 

This will show you only new files, not changed files - this would be much more complex to detect. There is also a non-zero chance that your installation program will create a file or directory with the name "home", "mnt", "sys", "proc" or "dev" which we would ignore, but the chances for this are pretty low in my opinion.

1
  • I hoped for some "finished tool" but your solution is general and useful on all distributions. Thx for your answer. Commented Mar 28, 2018 at 10:45
3

Checkinstall works exactly like you describe: it monitors file system changes performed by an installer process, and provides a way to roll them all back.

There are ways to turn the installation transcript into a regular package for a number of platforms (.deb, RPM, etc) but the tool is useful even if you don't want that, or your package manager isn't directly supported.

0

Based on Ned64's answer, I switched excluding names with excluding paths. I think it's more proper.

find / -xdev \( -path /mnt -o -path /proc -o -path /dev -o -path /sys \) -prune -o -print | sort > /root/files-before-install 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.