ldd scide | sed -nE 's/.*=> ([^ \t]+) .*/\1/p' | grep -v '^not$' | xargs ldd 2> /dev/null

I used this to find out which libraries that a certain program (or library) is linked to have missing dependencies. In my case I ran a partial update for icu, and that broke lots of things (mostly qt), and then I had to run out and find out which libraries still used the old version of icu.

Replace the argument to the ldd call at the beginning with the program you’re trying to get running again.

Combine with:

And this is how it looks:

$ ldd `which emacs` | sed -nE 's/.*=> ([^ \t]+) .*/\1/p' | grep -v '^not$' | xargs ldd 2> /dev/null
/usr/lib/libtiff.so.5:
  linux-vdso.so.1 (0x00007ffeba3ea000)
  liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007ff2be27b000)
  libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0x00007ff2be1e6000)
  libz.so.1 => /usr/lib/libz.so.1 (0x00007ff2bdfcf000)
  libm.so.6 => /usr/lib/libm.so.6 (0x00007ff2bde4a000)
  libc.so.6 => /usr/lib/libc.so.6 (0x00007ff2bdc86000)
  libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007ff2bdc65000)
  /usr/lib64/ld-linux-x86-64.so.2 (0x00007ff2be774000)
/usr/lib/libjpeg.so.8:
  linux-vdso.so.1 (0x00007ffff6bf1000)
  libc.so.6 => /usr/lib/libc.so.6 (0x00007f7fab9e8000)
  /usr/lib64/ld-linux-x86-64.so.2 (0x00007f7fabc43000)
/usr/lib/libpng16.so.16:
  linux-vdso.so.1 (0x00007ffe28792000)
  libz.so.1 => /usr/lib/libz.so.1 (0x00007f45b2fa6000)
  libm.so.6 => /usr/lib/libm.so.6 (0x00007f45b2e21000)
  libc.so.6 => /usr/lib/libc.so.6 (0x00007f45b2c5d000)
  /usr/lib64/ld-linux-x86-64.so.2 (0x00007f45b343e000)
/usr/lib/libgif.so.7:
  linux-vdso.so.1 (0x00007fff3350a000)
  libc.so.6 => /usr/lib/libc.so.6 (0x00007f09c8faf000)
  /usr/lib64/ld-linux-x86-64.so.2 (0x00007f09c93c8000)
/usr/lib/libXpm.so.4:
  linux-vdso.so.1 (0x00007ffc3ab9f000)
  libX11.so.6 => /usr/lib/libX11.so.6 (0x00007fcdaa3a2000)
  libc.so.6 => /usr/lib/libc.so.6 (0x00007fcdaa1de000)
  libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007fcda9fb5000)
  libdl.so.2 => /usr/lib/libdl.so.2 (0x00007fcda9fb0000)
  /usr/lib64/ld-linux-x86-64.so.2 (0x00007fcdaa73d000)
  libXau.so.6 => /usr/lib/libXau.so.6 (0x00007fcda9dac000)
  libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007fcda9ba6000)
/usr/lib/libgtk-3.so.0:
  <...>

Happy debugging random stuff… 🙄