Find programs that are missing libraries.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Find programs that are missing libraries.
# 1  
Old 05-19-2009
MySQL Find programs that are missing libraries.

I had to whip this up, and it seems useful enough to post here. Say you have been cleaning up your filesystem, and you removed a bunch of libraries, or you shuffled around some library directories, and aren't sure if ld.so.conf is correctly setup. You want to sweep through your file system looking for executables that cannot run because their libraries are now missing. Here's a really simple script to do just that:

Code:
find / -type f -exec file "{}" ";" | 
    awk '/dynamically linked/ { print $1 }' |
    sed 's/:$//' | 
    xargs ldd | 
    awk 'NF==1 {file=$1} /not found/ { print file, $1 }'

You might want to direct output to "tee" or perhaps just a file.

I only work with Linux these days. If you work with another OS and this script needs a tweak to work on it, please post a follow-up.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Yum install ClamAV missing libraries

Hello, I'm currently following a tutorial for ClamAV with a lambda function. The tutorial has a shell script with the following: #!/usr/bin/env bash set -e LAMBDA_FILE="lambda.zip" rm -f ${LAMBDA_FILE} mkdir -p clamav echo "-- Downloading AmazonLinux container --" docker pull... (1 Reply)
Discussion started by: ottorocket18
1 Replies

2. Solaris

Solaris: ldd doesn't find libraries in exported environment variable LD_LIBRARY_PATH

I have given the relevant details below. Why are the libraries in /export/home/builds/pc9x_root/960/build/powrmart/pmbuild/bin/SunOS.64.r are invisible to ldd? %setenv ... (3 Replies)
Discussion started by: old_as_a_fossil
3 Replies

3. Shell Programming and Scripting

find: missing argument to `-exec' while redirecting using find in perl

Hi Friends, Please help me to sort out this problem, I am running this in centos o/s and whenever I run this script I am getting "find: missing argument to `-exec' " but when I run the same code in the command line I didn't find any problem. I am using perl script to run this ... (2 Replies)
Discussion started by: ramkumarselvam
2 Replies

4. UNIX for Advanced & Expert Users

Shared hosting, how to install programs and libraries in your home folder

Hi all I hope I am posting in the right section. If not please excuse me and redirect me to the right section. Here is my problem: I am using a shared hosting plan at Godady. I have shell access and of course my own folder. I would like to be able to install programs in my own folder... (4 Replies)
Discussion started by: PiniFarini
4 Replies

5. UNIX for Dummies Questions & Answers

Are programs like sys_open( ) ,sys_read( ) et al examples of system level programs ?

Are the programs written on schedulers ,thread library , process management, memory management, et al called systems programs ? How are they different from the programs that implement functions like open() , printf() , scanf() , read() .. they have a prefix sys_open, sys_close, sys_read etc , right... (1 Reply)
Discussion started by: vishwamitra
1 Replies

6. HP-UX

Adode reader does not work - libraries are missing - where to get them?

Hi. I use HP-UX 11.23. After installation of adobe reader I've got the following error: /usr/lib/dld.sl: Can't open shared library: /user/unibat/hppahpux/gtk/usr/local/lib/libgdk_pixbuf_xlib-2.0.sl /usr/lib/dld.sl: No such file or directory The first library exists (dld.sl). Where could I... (4 Replies)
Discussion started by: netwalker
4 Replies

7. Solaris

where can I find programs for solaris?

I'm running Sun OS 5.9 and I need to find a place that has a precompiled version of the make command (I have no way of compiling software) and I would like to find a decent software repository, binaries are preferred but well maintained and easy to assemble (isn't lacking half a dozen dependencies... (7 Replies)
Discussion started by: tech53
7 Replies

8. Filesystems, Disks and Memory

How to find Dependent libraries in ELF file?

Dear group, I need to load dependent libraries for an application which is in ELF format.please let me know how to parse the ELF file to find dependent libraries. thnaks in advance, Ravinder (3 Replies)
Discussion started by: ravinder.are
3 Replies

9. Programming

makefile for programs using libraries loaded at runtime

Hi everybody! I would like to set in the makefile a path that should be the path where the program searches for the libraries loaded at run time. Is there such a variable to be set in makefile? Thanks in advance! (1 Reply)
Discussion started by: nadiamihu
1 Replies

10. Programming

libraries missing in C

some libraries are missing like conio.h and syslib.h how can i have them installed ? (4 Replies)
Discussion started by: C|[anti-trust]
4 Replies
Login or Register to Ask a Question
LDD(1)							      General Commands Manual							    LDD(1)

NAME
ldd - print shared library dependencies SYNOPSIS
ldd [OPTION]... FILE... DESCRIPTION
ldd prints the shared libraries required by each program or shared library specified on the command line. OPTIONS
--version Print the version number of ldd. -v --verbose Print all information, including e.g. symbol versioning information. -d --data-relocs Perform relocations and report any missing objects (ELF only). -r --function-relocs Perform relocations for both data objects and functions, and report any missing objects or functions (ELF only). -u --unused Print unused direct dependencies. --help Usage information. BUGS
ldd does not work on a.out shared libraries. ldd does not work with some extremely old a.out programs which were built before ldd support was added to the compiler releases. If you use ldd on one of these programs, the program will attempt to run with argc = 0 and the results will be unpredictable. AUTHOR
Roland McGrath and Ulrich Drepper. SEE ALSO
ldconfig(8), ld.so(8). 30 October 2000 LDD(1)