Le Bagage, Gautier Pelloux-Prayer

You are here:   Home > Welcome > Unix - error while loading shared libraries

Unix - error while loading shared libraries

  • Issue : during a ssh connection, I wasn't able to launch some manually compiled commands:
Command me.rincevent:~/travail : git
git: error while loading shared libraries: libcrypto.so.6: cannot open shared object file: No such file or directory

 

  • Solution : you just need to find this library for unix. How ? It's pretty simple :

1. First, find the system version of the lib (if nothing appears, you need to install the package) :

Command me.rincevent:~ : locate libcrypto
/usr/lib64/.libcrypto.so.1.0.0.hmac
/usr/lib64/.libcrypto.so.10.hmac
/usr/lib64/libcrypto.so.1.0.0
/usr/lib64/libcrypto.so.10

2. Then create a  "libs" directory, go through and make a symbolic link to the library (the last one here) :

mkdir $HOME/libs
ln -s /usr/lib64/libcrypto.so.10 $HOME/libs/libcrypto.so.6

3. Finally, you need to say to the system "hey, this is a lib folder, look inside !" :

Temporary way (current shell session) :

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/libs
export LD_LIBRARY_PATH

Permanent way, insert in ~/.bashrc :

if [ -z "$LD_LIBRARY_PATH" ]; then
    LD_LIBRARY_PATH=$HOME/libs
else
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/libs
fi
export LD_LIBRARY_PATH