On a UNIX / Linux system, how do I view which shared libraries a program needs?

To get a list of shared libraries that a program needs:

ldd /path/to/program

This will give you a list of the required shared libraries and the paths to the files that are being used for each requirement. If a file cannot be found for a particular requirement, it will say “file not found”. This can be caused by libraries being installed in non-standard paths. You can fix this by setting the LD_LIBRARY_PATH environment variable and setting it to the paths of any additional libraries. It’s sort of like the PATH environment variable, but for libraries.