First, use the
ldd command on the program binary to look at which dynamic libraries it is linked against. You'll need to satisfy those dependencies first, to make sure the program runs at all.
You can use the
strace command to see each syscall the program makes. To run an external program or script, the program must first fork and then exec. Since forking creates a child process, you need to use the
-f flag for trace -- "follow child processes too". The syscalls are output to standard error, and there will be a lot of them, so I personally like to redirect standard error to standard output, and pipe to
grep.
All in all,
Code:
strace -f program 2>&1 | grep -e '^exec'
will tell you which external commands the program attempts to run. You will most likely be also interested in the output of
Code:
strace -f program 2>&1 | grep -e '^open'
which lists all the files the program opens. This will include dynamic libraries that are not linked, but are loaded on demand programmatically.