0

I've encountered this problem several times.

Executing some "programs" results in something like

error while loading shared libraries: <name of lib>.so: cannot open shared object file: No such file or directory

My solution/workaround till today is: sudo find / -iname "<name of lib>.so"

then I've receive something like /usr/lib64/<name of lib>.so or even something more specific like /opt/tivoli/tsm/client/api/bin64/<name of lib>.so

then I add those paths (without the name of the lib) to the LD_LIBRARY_PATH environment variable and everything works.

But what is the correct way to handle those kind of error messages?

1 Answer 1

1

I think there's not much more that you can do. If library dependencies are missing, it means that those programs are not packaged well.

Normally there are two ways of handling dynamic libraries:

  • create a package that depends on the package containing the library
  • include the library in the distribution

Most programs in the standard repositories employ the first method, while games etc. normally use the second one, and then use a script to run the program in a locally modified environment, where a local directory is prepended to LD_LIBRARY_PATH.

But if neither of these is done, you have to do whatever it takes to get the library in LD_LIBRARY_PATH. If you don't want to pollute your environment, you can create a script for the program like this:

#!/bin/bash
export LD_LIBRARY_PATH=<lib_path>:$LD_LIBRARY_PATH
./<program_name>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.