[ACCEPTED]-What files did `make install` copy, and where?-installation

Accepted answer
Score: 17

I was just investigating this myself while 7 compiling a custom version of QEMU. I used 6 the following method to work out what was 5 installed and where (as well as using it 4 as a basis for a .deb file):

mkdir /tmp/installer
./configure --target-list=i386-softmmu
sudo make install DESTDIR=/tmp/installer
cd /tmp/installer
tree .

Tree is a utility that recursively displays the contents of a directory in a visually appealing manner - sudo apt-get install tree for Debian / Ubuntu users

Hope that helps 3 someone... it took me a bit of poking around 2 to nut it out, but I found it quite a useful 1 way of visualising what was going on.

Score: 15

The most fool-proof way is to use chroot: have 16 "make install" run inside a chroot jail; compute 15 a list of the files that you had before 14 the installation, and compare that to the 13 list of files after the installation.

Many 12 installations will support either a --prefix 11 configuration option, and/or a DESTDIR environment 10 variable. You can use those for a lighter-wait 9 version of chroot (trusting that the installation 8 will fail if it tries to write to a location 7 outside these if you run installation as 6 a fairly unprivileged user).

Another approach 5 is to replace the install program. Many 4 packages support an INSTALL environment 3 variable that, well, is the install program 2 to use; there are tracing versions of install 1 around.

Score: 7

make uninstall might show the files as it removes them 7 if the author of the compiling instructions 6 provides the information to allow an uninstall 5 (it has been awhile since I have done one 4 so I can't say for sure).

Also make -n install will do a 3 "dry run" of the install process and it may 2 be reasonable to extract the information 1 from its results.

Score: 4

It differs for every project that you run 6 'make install' on. The files which are 5 installed are controlled by the install 4 target in the Makefile being used. Your 3 best bet is to open the Makefile and search 2 for 'install:' - from there you can see 1 what files will be copied out to your system.

Score: 2
  1. Take a snapshot of the contents of the install location before installing
  2. Install
  3. Compare the current contents with the old contents.


./configure --prefix /usr/local
make -j`nproc`

find /usr/local | sort -u > /tmp/snapshot1
make install
find /usr/local | sort -u > /tmp/snapshot2
comm -3 /tmp/snapshot{1,2} # this prints the files added by `make install` to stdout


More Related questions