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:
Find where the library is placed if you don't know it.
sudo find / -name the_name_of_the_file.soCheck for the existence of the dynamic library path environment variable(
LD_LIBRARY_PATH)echo $LD_LIBRARY_PATHIf there is nothing to be displayed, add a default path value (or not if you wish to)
LD_LIBRARY_PATH=/usr/local/libWe add the desired path, export it and try the application.
Note that the path should be the directory where the
path.so.somethingis. So ifpath.so.somethingis 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 OverflowLinux error while loading shared libraries: cannot open shared object file: No such file or directory - Stack Overflow
Ubuntu 22.03.3 LTS // error while loading shared libraries: libpdal_base.so.13: cannot open shared object file
Error while loading shared libraries (Ubuntu)
Error while loading shared libraries
Videos
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:
Find where the library is placed if you don't know it.
sudo find / -name the_name_of_the_file.soCheck for the existence of the dynamic library path environment variable(
LD_LIBRARY_PATH)echo $LD_LIBRARY_PATHIf there is nothing to be displayed, add a default path value (or not if you wish to)
LD_LIBRARY_PATH=/usr/local/libWe add the desired path, export it and try the application.
Note that the path should be the directory where the
path.so.somethingis. So ifpath.so.somethingis in/my_library/path.so.something, it should be:export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/my_library/
Reference to source
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
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
For a so called 64-bit application prime needs a bunch i386 libaries. sudo dpkg --add-architecture i386 afterwards sudo apt update
Make sure the not founding libaries are installed for 64-bit and 32-bit.
You can found the relevant packages with apt-file search missing file.
maybe you have to install it sudo apt install apt-file and sudo apt-file update

How to use apt-file
Create a symbolic link
If you have the file
/usr/lib/x86_64-linux-gnu/libboost_system.so.1.55.064-bit
sudo ln -s /usr/lib/x86_64-linux-gnu/libboost_system.so.1.55.0 /usr/lib/x86_64-linux-gnu/libboost_system.so.1.46.132-bit
sudo ln -s /usr/lib/i386-linux-gnu/libboost_system.so.1.55.0 /usr/lib/i386-linux-gnu/libboost_system.so.1.46.1If you have the file
/usr/lib/x86_64-linux-gnu/libboost_system.so.1.54.064-bit
sudo ln -s /usr/lib/x86_64-linux-gnu/libboost_system.so.1.54.0 /usr/lib/x86_64-linux-gnu/libboost_system.so.1.46.132-bit
sudo ln -s /usr/lib/i386-linux-gnu/libboost_system.so.1.54.0 /usr/lib/i386-linux-gnu/libboost_system.so.1.46.1
Alternative
Download and install the packages from here.
Ocelot is looking for an older version of boost. You'll either have to create a ton of symlinks to get Ocelot to think it's the right version or downgrade boost.
Here's a link to getting a specific version of boost .
you can either
install the supplied .deb file available from
https://packages.ubuntu.com/xenial/amd64/libpng12-0/download
http://security.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1.1_amd64.deb
sudo dpkg -i ./libpng12-0_1.2.54-1ubuntu1.1_amd64.deb
or compile and install :
download source code https://packages.ubuntu.com/xenial/libpng12-0
wget http://archive.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng_1.2.54.orig.tar.xz
tar xvf libpng_1.2.54.orig.tar.xz
cd libpng-1.2.54
./autogen.sh
./configure
make -j8
sudo make install
then update the links with:
sudo ldconfig
prior to any of this assure your machine has these preliminary packages installed ... baseline for any dev kit
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libtool autoconf build-essential pkg-config automake tcsh
good news is freesurfer 7 on Ubuntu 20.04 runs fine out of the box
The software you are trying to run requires version 12 of libpng, which is no longer available in Ubuntu 16.10+. The best thing to do would be to install Ubuntu 16.04, or maybe let the developers of the software know about this problem so they can provide a version compatible with Ubuntu 16.10.