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
LIBBASH(7)							  libbash Manual							LIBBASH(7)

NAME
libbash -- A bash shared libraries package. DESCRIPTION
libbash is a package that enables bash dynamic-like shared libraries. Actually its a tool for managing bash scripts whose functions you may want to load and use in scripts of your own. It contains a 'dynamic loader' for the shared libraries ( ldbash(1)), a configuration tool (ldbashconfig(8)), and some libraries. Using ldbash(1) you are able to load loadable bash libraries, such as getopts(1) and hashstash(1). A bash shared library that can be loaded using ldbash(1) must answer 4 requirments: 1. It must be installed in $LIBBASH_PREFIX/lib/bash (default is /usr/lib/bash). 2. It must contain a line that begins with '#EXPORT='. That line will contain (after the '=') a list of functions that the library exports. I.e. all the function that will be usable after loading that library will be listed in that line. 3. It must contain a line that begins with '#REQUIRE='. That line will contain (after the '=') a list of bash libraries that are required for our library. I.e. every bash library that is in use in our bash library must be listed there. 4. The library must be listed (For more information, see ldbashconfig(8)). Basic guidelines for writing library of your own: 1. Be aware, that your library will be actually sourced. So, basically, it should contain (i.e define) only functions. 2. Try to declare all variables intended for internal use as local. 3. Global variables and functions that are intended for internal use (i.e are not defined in '#EXPORT=') should begin with: __<library_name>_ For example, internal function myfoosort of hashstash library should be named as __hashstash_myfoosort This helps to avoid conflicts in global name space when using libraries that come from different vendors. 4. See html manual for full version of this guide. AUTHORS
Hai Zaar <haizaar@haizaar.com> Gil Ran <ril@ran4.net> SEE ALSO
ldbash(1), ldbashconfig(8), getopts(1), hashstash(1) colors(1) messages(1) urlcoding(1) locks(1) Linux Epoch Linux