1

If I have a shared library called libAlpha.so, then in Ubuntu I can find its dependencies by running the command ldd libAlpha.

Is there a similar command in Ubuntu to find the dependencies of an executable?

manlio
  • 18,345
  • 14
  • 76
  • 126
Karnivaurus
  • 22,823
  • 57
  • 147
  • 247
  • 4
    `ldd` works for executables too – Kuba Jan 08 '15 at 12:25
  • 1
    Some executables *require* some plugins but load them at runtime using `dlopen` (so `ldd` won't show you that). You could also use `pmap` or `cat /proc/$(pidof executable)/maps` to understand the actually used shared libraries. – Basile Starynkevitch Jan 08 '15 at 12:28

2 Answers2

2

ldd should work for executables.

You can also try readelf -d (shows only direct dependencies).

Community
  • 1
  • 1
manlio
  • 18,345
  • 14
  • 76
  • 126
2

lddworks fine on executables too.

Just pass the path to the executable : ldd /bin/ls

dkg
  • 1,775
  • 14
  • 34