I feel lucky in stumbling across this solution, but wanted to post it up in case anyone else runs across this issue in installing legacy software.

Assuming the install anywhere script is called Install.bin

# cp Install.bin Install.bak
# cat Install.bak | sed "s/export LD_ASSUME_KERNEL/#xport LD_ASSUME_KERNEL/" > Install.bin
# rm Install.bak

This worked nicely.

The fix was originally posted on the Zend Knowledgebase (now 404'ed), it is still archived on linuxquestions.org.

Answer from a coder on Stack Exchange
🌐
GitHub
github.com › input-output-hk › daedalus › issues › 2802
error while loading shared libraries: libdl.so.2 · Issue #2802 · input-output-hk/daedalus
January 3, 2022 - I have download today the binary, but when I try to run it, it crashes: ./daedalus-4.6.0-mainnet-20052.bin ./nix/store/s74k20bgs8bm8267mifzxsmkgm2n94hb-nix-user-chroot-2c52b5f/bin/nix-user-chroot: error while loading shared libraries:...
Author   input-output-hk
Discussions

operator: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
With the latest version v1.34.0 Tigera operator Pod is going crashlookbackoff in EKS cluster stating below error - operator: error while loading shared libraries: libdl.so.2: cannot open shared obj... More on github.com
🌐 github.com
5
May 17, 2024
libdl.so.2 error in postgres container
/bin/sh: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory More on github.com
🌐 github.com
6
December 11, 2019
Linux Error error while loading shared libraries
Find answers to Linux Error error while loading shared libraries from the expert community at Experts Exchange More on experts-exchange.com
🌐 experts-exchange.com
February 17, 2010
Missing libdl.so and other basic libraries
While using the new .net 8.0 i got this super weird error, on monday, everything worked fine, last build was on 00:15 gmt +1 (or 2 no idea actually like gets summertime accounted or not?) Well what... More on github.com
🌐 github.com
7
1
Top answer
1 of 16
622

Your library is a dynamic library. You need to tell the operating system where it can locate it at runtime.

To do so, we will need to do those easy steps:

  1. Find where the library is placed if you don't know it.

    sudo find / -name the_name_of_the_file.so
    
  2. Check for the existence of the dynamic library path environment variable(LD_LIBRARY_PATH)

    echo $LD_LIBRARY_PATH
    

    If there is nothing to be displayed, add a default path value (or not if you wish to)

    LD_LIBRARY_PATH=/usr/local/lib
    
  3. We add the desired path, export it and try the application.

    Note that the path should be the directory where the path.so.something is. So if path.so.something is in /my_library/path.so.something, it should be:

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/my_library/
    

Reference to source

2 of 16
269

Here are a few solutions you can try:

ldconfig

As AbiusX pointed out: If you have just now installed the library, you may simply need to run ldconfig.

sudo ldconfig

ldconfig creates the necessary links and cache to the most recent shared libraries found in the directories specified on the command line, in the file /etc/ld.so.conf, and in the trusted directories (/lib and /usr/lib).

Usually your package manager will take care of this when you install a new library, but not always, and it won't hurt to run ldconfig even if that is not your issue.

Dev package or wrong version

If that doesn't work, I would also check out Paul's suggestion and look for a "-dev" version of the library. Many libraries are split into dev and non-dev packages. You can use this command to look for it:

apt-cache search <libraryname>

This can also help if you simply have the wrong version of the library installed. Some libraries are published in different versions simultaneously, for example, Python.

Library location

If you are sure that the right package is installed, and ldconfig didn't find it, it may just be in a nonstandard directory. By default, ldconfig looks in /lib, /usr/lib, and directories listed in /etc/ld.so.conf and $LD_LIBRARY_PATH. If your library is somewhere else, you can either add the directory on its own line in /etc/ld.so.conf, append the library's path to $LD_LIBRARY_PATH, or move the library into /usr/lib. Then run ldconfig.

To find out where the library is, try this:

sudo find / -iname *libraryname*.so*

(Replace libraryname with the name of your library)

If you go the $LD_LIBRARY_PATH route, you'll want to put that into your ~/.bashrc file so it will run every time you log in:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/library
🌐
GitHub
github.com › tigera › operator › issues › 3353
operator: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory · Issue #3353 · tigera/operator
May 17, 2024 - With the latest version v1.34.0 Tigera operator Pod is going crashlookbackoff in EKS cluster stating below error - operator: error while loading shared libraries: libdl.so.2: cannot open shared obj...
Author   tigera
🌐
Baeldung
baeldung.com › home › files › solving the “cannot open shared object file: no such file or directory” error in linux
Solving The “Cannot Open Shared Object File: No Such File Or Directory” Error In Linux | Baeldung on Linux
January 14, 2026 - In the above example, the missing library’s name was libzstd.so, but there is no package called libzstd. As a result, we had to guess and search for just zstd instead. We can specify the directories to be searched for shared libraries in the LD_LIBRARY_PATH environment variable.
🌐
GitHub
github.com › zalando › postgres-operator › issues › 758
libdl.so.2 error in postgres container · Issue #758 · zalando/postgres-operator
December 11, 2019 - /bin/sh: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory Images in use: registry.opensource.zalan.do/acid/postgres-operator:latest registry.opensource.zalan.do/acid/spilo-11:1.6...
Author   zalando
🌐
Linux Mint Forums
forums.linuxmint.com › board index › main edition support › software & applications
[SOLVED] Missing libdl.so.2 Error during installation - Linux Mint Forums
April 13, 2010 - Configuring the installer for this system's environment... nawk: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory /bin/ls: ...
🌐
Experts Exchange
experts-exchange.com › questions › 25150132 › Linux-Error-error-while-loading-shared-libraries.html
Solved: Linux Error error while loading shared libraries | Experts Exchange
February 17, 2010 - To get some idea of how your drives are partitioned, you can try # blkid (and hope you have that program on the CD) # fdisk might help too but don't change anything. Mount every drive that can be mounted. Look for library files. One way to search is # find / -name libdl.so.2 Remember, you might find one of your CD and that won't help much.
Find elsewhere
🌐
Medium
54sakuramiku.medium.com › centos7-lampp-cannot-open-shared-object-file-no-such-file-or-directory-c9d16558aee9
CentOS 7 LAMPP cannot open shared object file: No such file or directory | by Sheng-Shan Chen | Medium
April 19, 2021 - ** (gedit:10150): WARNING **: 10:15:59.822: Set document metadata failed: Setting attribute metadata::gedit-position not supported [root@localhost ~]# sudo /opt/lampp/lampp start /bin/sh: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory /bin/sh: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory /bin/bash: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory /bin/sh: error while loading shared libraries: libdl.so.2: cannot op
🌐
Vocal Media
vocal.media › geeks › cannot-open-shared-object-file-no-such-file-or-directory
Cannot Open Shared Object File: No Such File or Directory | Geeks
The error message “Cannot open shared object file: No such file or directory” typically occurs when a program or application tries to load a shared library (.so file) but cannot locate it.
🌐
Linux Questions
linuxquestions.org › questions › linux-software-2 › passwd-error-while-loading-shared-libraries-libdl-so-2-a-4175500403
passwd: error while loading shared libraries: libdl.so.2
I am using Red Hat Enterprise Linux Server Release 6.4 (Santiago). I have a problem with the 'passwd' command. Everytime I call this command (in the
🌐
GitHub
github.com › termux › termux-x11 › issues › 753
[Bug]: sh: error while loading shared libraries: libdl.so: cannot open shared object file: No such file or directory · Issue #753 · termux/termux-x11
November 22, 2024 - it show sh: error while loading shared libraries: libdl.so: cannot open shared object file: No such file or directory sh: error while loading shared libraries: libc.so: cannot open shared object file: No such file or directory · after I make softlink in /lib/aarch64-linux-gnu ln s libdl.so.2 libdl.so ln s libc.so.6 libc.so
Author   termux
🌐
GitHub
github.com › SAP › node-rfc › issues › 23
Error: libdl.so.1: cannot open shared object file: No such file or directory · Issue #23 · SAP-archive/node-rfc
January 29, 2017 - Hi everyone, i tried on ubuntu and debian, and get on both systems the following error, can anybody help? module.js:434 return process.dlopen(module, path._makeLong(filename)); ^ Error: libdl.so.1: cannot open shared object file: No such...
Author   SAP-archive