Bob Kircher wrote:
> Because my Linux app needs to be distributed with the OS, and I want
> to minimize the overall size of the distribution, I need to determine
> the smallest set of packages that are required to run my app.
>
> Is there a programmatic way to determine this?
>
You can find out part of what you need with the ldd command that shows
you which libraries are used by your program. For example,
valinux:jdbeyer[~/bin]$ ldd
libdb2.so.1 => /home/db2inst1/sqllib/lib/libdb2.so.1 (0x40015000)
libc.so.6 => /usr/i386-glibc21-linux/lib/libc.so.6 (0x4083f000)
/usr/i386-glibc21-linux/lib/ld-linux.so.2 =>
/usr/i386-glibc21-linux/lib/ld-linux.so.2 (0x40000000)
libstdc++-libc6.2-2.so.3 => /usr/lib/libstdc++-libc6.2-2.so.3 (0x40948000)
libm.so.6 => /usr/i386-glibc21-linux/lib/libm.so.6 (0x4098c000)
libcrypt.so.1 => /usr/i386-glibc21-linux/lib/libcrypt.so.1 (0x409a9000)
libdl.so.2 => /usr/i386-glibc21-linux/lib/libdl.so.2 (0x409d6000)
libpthread.so.0 => /usr/i386-glibc21-linux/lib/libpthread.so.0 (0x409da000)
Then, assuming your system uses rpm, you could do things like:
valinux:jdbeyer[~/bin]$ rpm -qf /home/db2inst1/sqllib/lib/libdb2.so.1
/usr/i386-glibc21-linux/lib/libc.so.6
db2cliv61-6.1.0-60
compat-glibc-6.2-2.1.3.2
etc.
Now if your program forks and execs other processes, you would have to
know that and work on them as well.
--
.~. Jean-David Beyer Registered Linux User 85642.
/V\ Registered Machine 73926.
/( )\ Shrewsbury, New Jersey
http://counter.li.org
^^-^^ 2:30pm up 1 day, 1:58, 2 users, load average: 3.36, 3.36, 3.36