From ldd, it is clear that prime is a 32bit/i386 build. It requires dependencies from same architecture. We may confirm too using:

file ./prime

We search for each missing library file using apt-file (if installed, be aware it downloads large indexes) or https://packages.ubuntu.com for corresponding package then install it.

sudo apt install libsigsegv2:i386 \
libsdl1.2debian:i386 libsdl-image1.2:i386 liblua5.1-0:i386 \
libsdl-mixer1.2:i386 libsdl-net1.2:i386 
Answer from user.dz on askubuntu.com
🌐
It's FOSS
itsfoss.com › solve-open-shared-object-file-quick-tip
[Solved] cannot open shared object file Error in Ubuntu
April 16, 2023 - Complete detailed solution for fixing “error while loading shared libraries” error in Ubuntu-based Linux distributions.
🌐
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 this tutorial, we’ll go through various causes and fixes for the “cannot open shared object file: No such file or directory” error in Linux.
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
🌐
AllThings
allthings.how › all things how › windows › how to fix “error while loading shared libraries: cannot open shared object file: no such file or directory”
How to Fix “error while loading shared libraries: cannot open shared object file: No such file or directory”
April 4, 2025 - The error while loading shared libraries: cannot open shared object file: No such file or directory message typically occurs when Linux programs can’t locate the required shared library (.so) files at runtime.
🌐
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
For instance, if the library file or directory has restrictive permissions, the system won’t be able to access it. ... If you’re using a 64-bit system but trying to load a 32-bit library (or vice versa), the system won’t be able to open the shared object file. ... Sometimes, symbolic links pointing to the shared library might be broken or corrupted, leading to the error. How to Fix “Cannot Open Shared Object File: No Such File or Directory”
🌐
UbuntuMint
ubuntumint.com › home › how to fix “cannot open shared object file” error in ubuntu
How to Fix “cannot open shared object file” Error in Ubuntu
July 24, 2023 - In this case, the term libexpat suggests library expat and we, therefore, need to search expat and not libexpat. ... The LD_LIBRARY_PATH environment variable can be used to specify the directories that should be searched for missing shared libraries.
🌐
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
🌐
GitHub
github.com › openvenues › pypostal › issues › 54
Ubuntu: libpostal.so.1: cannot open shared object file: No such file or directory · Issue #54 · openvenues/pypostal
November 25, 2019 - I seemed to have the same problem as issue #8 cannot open shared object file: No such file or directory I tried the fixes suggested in the issue including adding export LD_LIBRARY_PATH=/usr/local/lib (lib being where libpostal is install...
Author   openvenues
Find elsewhere
🌐
Edaboard
edaboard.com › eda software › linux software
cannot open shared object file: No such file or directory. Ubuntu | Forum for Electronics
October 18, 2011 - Hi all I was making mistake to add a line LD_ASUME_KERNER something in .bashrc and when the system block my work when i want to do job in terminal by showing error: ls: error while loading shared libraries: librt.so.1: cannot open shared object file: No such file or directory Because of the...
🌐
Substack
smart338.substack.com › smart’s substack › cannot open shared object file: no such file or directory [solved fixed]
Cannot Open Shared Object File: No Such File or Directory [Solved Fixed]
January 25, 2025 - In some cases, the error might be caused by insufficient permissions. For instance, if the library file or directory has restrictive permissions, the system won’t be able to access it.
🌐
Launchpad
answers.launchpad.net › ubuntu › +source › bash › +question › 703133
Question #703133 “libgdbm.so.2: cannot open shared object file: ...” : Questions : bash package : Ubuntu
hmm_run: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory Can't open chunkout3559: No such file or directory at /home/ajusha/ ... libgdbm.so.2 is an obsolete version of the library. Current Ubuntu releases contain libgdbm.so.3, libgdbm.so.5 or libgdbm.so.6
Top answer
1 of 2
10

Creating a symbolic link to /usr/lib/libfreetype.so.6 should not be applied if the error was thrown by a 32-bit application on a 64-bit Linux distribution. The library could be left 'broken'.

What you want on a 64-bit system is to install the necessary 32-bit dependencies around your 32-bit application, so that it will be able to detect and use the already existing libfreetype.so.6. This differs per application, but commonly missing are these:

sudo apt-get install libgtk2.0-0:i386 libidn11:i386 libglu1-mesa:i386

And these may possibly fix the problem too:

sudo apt-get install libpangox-1.0-0:i386 libpangoxft-1.0-0:i386

Regards, Albert Kok

2 of 2
0

I was able to fix this problem however I'm still not entirely sure why this was a problem in the first place.

After running strace, I saw open("/usr/local/lib/libfreetype.so.6", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied) which doesn't quite make sense since other programs (without sudo powers) which depended on libfreetype were able to run, and the permissions are set for read/write for all, also running evince under sudo didn't help either.

My apt-get of libfreetype placed the library in /usr/lib/x86_64-linux-gnu/libfreetype.so.6 but for some reason evince wasn't checking that folder (even though it was added to LD_LIBRARY_PATH). However I created a symbolic link to a folder which it does check sudo ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so.6.10.1 /usr/lib/libfreetype.so.6 and now evince runs fine.

🌐
OTLand
otland.net › forums › opentibia › support
Compiling - [Ubuntu 16.04.7 LTS] - "cannot open shared object file: No such file or directory" | OTLand
April 8, 2023 - Welcome to Ubuntu 16.04.7 LTS (GNU/Linux 4.4.0-186-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory Hello, I have a problem.
🌐
GitHub
github.com › apollographql › router › issues › 2623
Ubuntu: libssl.so.1.1: cannot open shared object file: No such file or directory · Issue #2623 · apollographql/router
February 16, 2023 - This pinned issue shows you how to work around a temporary openssl related issue. Ubuntu 22.XX doesn't provide libssl@1.1 anymore. The router will fail to start and show this error: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
Author   apollographql