There is an executable I want to install on a computer that I can't recompile that wasn't built as a package, and I want to download the libraries it requires to run them.Below is part of the output from running ldd on itlibpango-1.0.so.0 => /usr/lib/i386-linux-gnu/libpango-1.0.so.0 (0xb702f000)libcairo.so.2 => /usr/lib/i386-linux-gnu/libcairo.so.2 (0xb6f64000)libatk-1.0.so.0 => /usr/lib/i386-linux-gnu/libatk-1.0.so.0 (0xb6f43000)libsqlite3.so.0 => /usr/lib/i386-linux-gnu/libsqlite3.so.0 (0xb6e9e000)libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb6cf4000)/lib/ld-linux.so.2 (0xb786e000)libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0xb6cd3000)libgio-2.0.so.0 => /usr/lib/i386-linux-gnu/libgio-2.0.so.0 (0xb6b7c000)libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb6b4f000)Is there a tool that can use this information to select which packages should be downloaded or better yet extract only the libraries listed and their dependencies, in order to minimize the disk usage? The system is running on a headless VM and the program will be displayed via VNC.Although I suspect that a full blown graphics desktop will supply most of the libraries needed I want to download only the required libraries, their dependencies and just enough of the X Windows package to support it.
Is there a way to determine what packages or libraries should be loaded to support an executable?
package management;libraries;dependencies
You have not said which OS you are using so I am going to assume Linux and will use Debian as an example. The quick answer to your question is no as far as I know. This might be a useful workaround though:ldd your_prog | awk '{print $1}' | sed 's/\..*//' |   while read n; do echo ----- $n ----; apt-cache search ^$n; doneThis will parse the ldd output and then run apt-cache (replace that with the equivalent for your OS) to search the repositories for packages whose name and description contains the first part of the library name returned by ldd. This will not find all of them and will give too many results for some (like libc) but it could be helpful. @FaheemMitha pointed out that apt-file might be a better way. For example:ldd /bin/bash | awk '/=>/{print $(NF-1)}'  |  while read n; do apt-file search $n; done |  awk '{print $1}' | sed 's/://' | sort | uniqThat will return a list of package names that provide the linked libraries. 