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 - <> ./daedalus-4.6.0-mainnet-20052.bin ./nix/store/s74k20bgs8bm8267mifzxsmkgm2n94hb-nix-user-chroot-2c52b5f/bin/nix-user-chroot: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
Author   input-output-hk
Discussions

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 while loading shared libraries: cannot open shared object file: No such file or directory - Stack Overflow
Program is part of the Xenomai test suite, cross-compiled from Linux PC into Linux+Xenomai ARM toolchain. # echo $LD_LIBRARY_PATH ... More on stackoverflow.com
🌐 stackoverflow.com
error while loading shared libraries: libdl.so.2: cannot open shared object - Oracle Forums
I got the error when I run the Identity server "./start_ois_server" Using Linux Threading Library. /opt/netpoint/identity/oblix/apps/common/bin/ois_server: error while loading shared librar... More on forums.oracle.com
🌐 forums.oracle.com
June 22, 2023
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
🌐
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 › 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
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
🌐
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
🌐
Oracle
forums.oracle.com › ords › apexds › post › error-while-loading-shared-libraries-libdl-so-2-cannot-open-6207
error while loading shared libraries: libdl.so.2: cannot open shared object - Oracle Forums
June 22, 2023 - I got the error when I run the Identity server "./start_ois_server" Using Linux Threading Library. /opt/netpoint/identity/oblix/apps/common/bin/ois_server: error while loading shared librar...
🌐
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: ...
Find elsewhere
🌐
FedoraForum.org
forums.fedoraforum.org › archive › index.php › t-106097.html
Error while loading shared libraries libdl.so.2 [Archive] - FedoraForum.org
More details: $ whereis libdl.so.2 libdl.so: /lib/libdl.so.2 /usr/lib/libdl.so and cd /lib/ $ ls -l libdl.so* lrwxrwxrwx 1 root root 12 Apr 20 13:03 libdl.so.2 -> libdl-2.4.so and cd /usr/lib/ $ ls -l libdl.so* lrwxrwxrwx 1 root root 20 Apr 20 13:09 libdl.so -> ../../lib/libdl.so.2 Thanks in advance I have never used edonkey buy are you sure it's using the correct library? What is your output from: ldd <edonkey binary> env | grep LD_LIBRARY_PATH You also might want to try: strace edonkey and see where it is sourcing libdl.so.2 from Gaz
🌐
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 object file: No such file or directory Trie...
Author   tigera
🌐
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.
🌐
Onlineappsdba
onlineappsdba.com › home › blog › /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 -
February 10, 2012 - Today I have faced some library file issue while bringing up the OAM components. ... We have installed the base version of osinfra application server (version: 101401) and then we applied osinfra patch (p7215628_101430_LINUX). OHS not starting after Webpass installation. Even after setting LD_ASSUME_KERNEL parameter in opmn.xml and commenting perl and php modules in httpd.conf file. ... Setting the environment variable LD_ASSUME_KERNEL was the causing below error message.
Top answer
1 of 1
5

TL;DR: This is a building issue with the application, the application was incorrectly built and linked against libdl.so. For Linux support, the software must be rebuilt and linked to libdl.so.2 instead.

In this specific stack trace, the crash is in the C# pythonnet stack, fixed in pythonnet >= 3.0

More Explanation:

This is the standard glibc library. It's often linked automatically when binaries are created or it's often hardcoded in specific builds (the library is used to load further libraries).

The library is libdl.so.2 in Linux distributions (Debian, RHEL, Ubuntu, etc...). It was historically libdl.so in older operating systems and Unix variants.

Both have been coexisting for a while and causing confusion:

  • On CentOS, libdl.so can be installed by sudo yum install glibc-devel
  • On Debian and Ubuntu <=20, libdl.so can be installed by sudo apt-get install libc6-dev
  • On Ubuntu >= 22, libdl.so no longer exists, it can't be installed by libc6-dev (nor gcc).

The dev glibc package is a transitive dependency of gcc. It's very common for gcc to be installed on Linux machines (developer machines and end-user machines alike), so it's very common for libdl.so to be accidentally available. It's not part of the base operating system and should not be expected to be available.

Software that have been linked to libdl.so will crash when the library is not available. It's a long standing issue. It's getting more noticeable due to Ubuntu 22 lately, it was only noticeable in containers and minimal OS install before (no gcc).

In this specific stack trace, the crash was in the C# pythonnet stack, the linking was fixed in pythonnet >= 3.0

🌐
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 - $ export LD_LIBRARY_PATH=/home/baeldung/libs $ ldd ./program ./program: linux-vdso.so.1 (0x00007ffe28dfd000) libfoo.so => /home/baeldung/libs/libfoo.so (0x00007f8f0f7ba000) libc.so.6 => /usr/lib/libc.so.6 (0x00007f8f0f59d000) /lib/ld-linux-x86-64.so.2 => /usr/lib/ld-linux-x86-64.so.2 (0x00007f8f0f7c6000) Additionally, if we don’t know where the library is, we can locate it using the find command in common paths such as /home or /usr: $ find /home -type f -name libfoo.so /home/baeldung/libs/libfoo.so · We can use the /etc/ld.so.conf file to permanently set the library search path. In this fi
🌐
It's FOSS
itsfoss.com › solve-open-shared-object-file-quick-tip
[Solved] cannot open shared object file Error in Ubuntu
April 16, 2023 - One quick way to fix this “error while loading shared libraries” automatically is to use ldconfig. All you need to do is to open the terminal (Ctrl+Alt+T) and type the following command: ... This one-liner should solve the problem in most cases.
🌐
USC
neuroimage.usc.edu › discussions
DUNEURO error libdl.so.2 - Discussions - Brainstorm
May 18, 2020 - Hi everyone, I was trying to use DUNEURO for the FEM forward model but I have the following error: DUNEURO> Installation path: /home/duma/.brainstorm/bst_duneuro/bin/bst_duneuro_meeg_linux64 DUNEURO> Writing temporary files to: /home/duma/.brainstorm/tmp DUNEURO> System call: "/home/duma/.brainstorm/bst_duneuro/bin/bst_duneuro_meeg_linux64" "/home/duma/.brainstorm/tmp/duneuro_minifile.mini" DUNEURO> Error log: /home/duma/.brainstorm/bst_duneuro/bin/bst_duneuro_meeg_linux64: error while load...