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

Answer from XOR on Stack Overflow
🌐
Command Linux
commandlinux.com › home › how to › how to fix “error while loading shared libraries” problem on linux
How To Fix "Error While Loading Shared Libraries" Problem on Linux
February 3, 2026 - This error occurs when a program can’t find its required .so files. The lib might be gone, put in a strange spot, or not match your box type. Check the error message for the library filename.
🌐
Bobcares
bobcares.com › blog › ubuntu-error-while-loading-shared-libraries
Ubuntu Error while loading shared libraries - Now what
August 22, 2020 - Ubuntu Error while loading shared libraries occurs when the library your program is looking for is not available on the server.
Discussions

Linux error while loading shared libraries: cannot open shared object file: No such file or directory - Stack Overflow
And Linux, unlike Windows, does NOT default to loading libraries from the current directory (next to the executable) 2025-10-02T16:41:38.127Z+00:00 ... turtl: error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory More on stackoverflow.com
🌐 stackoverflow.com
Ubuntu 22.03.3 LTS // error while loading shared libraries: libpdal_base.so.13: cannot open shared object file
What is the bug or the crash? Seems to be similar to : #52433 I work on unbuntu 22.04.03 LTS. I succeed many weeks ago to install/use qgis Lima 3.32.2 on this station. But i was facing to several e... More on github.com
🌐 github.com
3
November 2, 2023
Error while loading shared libraries (Ubuntu)
./flutter_launcher: error while loading shared libraries: libglfw.so.3: cannot open shared object file: No such file or directory More on github.com
🌐 github.com
8
January 9, 2019
Error while loading shared libraries
Installing stuff in Terminal is just as easy as sudo apt-get install [packagename]. Be sure to have libidn installed. More on reddit.com
🌐 r/techsupport
6
1
October 2, 2022
🌐
It's FOSS
itsfoss.com › solve-open-shared-object-file-quick-tip
[Solved] cannot open shared object file Error in Ubuntu
April 16, 2023 - The reason behind this error is that the libraries of the program have been installed in a place where the dynamic linker cannot find them. Let me show you how you can go about fixing this issue.
🌐
Linux Questions
linuxquestions.org › questions › linux-software-2 › error-while-loading-shared-libraries-no-such-file-or-directory-4175717461
"error while loading shared libraries" "No such file or directory"
October 5, 2022 - I have for the first time installed a Ubuntu system. I downloaded the image off the Ubuntu site and installed it OK. Everything seemed to work OK
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
Find elsewhere
🌐
NI18
blog.ni18.in › how-to-fix-the-error-while-loading-shared-libraries-in-linux
How to Fix the "Error While Loading Shared Libraries" in Linux - ni18 Blog
February 8, 2025 - Install the 32-bit version (on 64-bit systems): On Debian/Ubuntu-based systems, use: sudo apt install libxyz:i386 Replace libxyz:i386 with the appropriate library name. To make sure your program isn’t missing other shared libraries, you can use the ldd command to check for unresolved dependencies.
🌐
FOSTips
fostips.com › blog › linux › how to fix “error while loading shared libraries” issue in ubuntu linux
How to Fix "error while loading shared libraries" Issue in Ubuntu Linux - FOSTips
May 7, 2021 - error while loading shared libraries: LIBRARY_NAME: cannot open shared object file: No such file or directory · The solution is easy! Just manually search for the package name and install it. And this works in Ubuntu, Debian, Fedora, and all ...
🌐
GitHub
github.com › qgis › QGIS › issues › 55129
Ubuntu 22.03.3 LTS // error while loading shared libraries: libpdal_base.so.13: cannot open shared object file · Issue #55129 · qgis/QGIS
November 2, 2023 - /usr/lib/qgis/crssync: error while loading shared libraries: libpdal_base.so.13: cannot open shared object file: No such file or directory dpkg: erreur de traitement du paquet qgis-providers (--configure) : installed qgis-providers package post-installation script subprocess returned error exit status 127 dpkg: des problèmes de dépendances empêchent la configuration de qgis : qgis dépend de qgis-providers (= 1:3.34.0+36jammy) ; cependant : Le paquet qgis-providers n'est pas encore configuré.
Author   qgis
🌐
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 - First, let’s confirm the exact libraries that the program links to using the ldd command: $ ./program ./program: error while loading shared libraries: libfoo.so: cannot open shared object file: No such file or directory $ ldd ./program ./program: linux-vdso.so.1 (0x00007ffce871b000) libfoo.so ...
🌐
GitHub
github.com › putraxor › flutter_desktop_launcher › issues › 5
Error while loading shared libraries (Ubuntu) · Issue #5 · putraxor/flutter_desktop_launcher
January 9, 2019 - ./flutter_launcher: error while loading shared libraries: libglfw.so.3: cannot open shared object file: No such file or directory
Author   putraxor