[Samtools] Run error: error while loading shared libraries: libcrypto.so.1.0.0 or libncurses.so.5 or libtinfow.so.5

After samtools is installed with conda, there is always an error that the shared library is missing. Even if you can use samtools when you just installed it, but installing other related software in the same environment later, there may be conflicts, resulting in library replacement, and thus an error.

To avoid this situation, it may be best to give samtools a separate environment. But I don’t like this. My habit is to build an environment only after doing one thing. Otherwise, there are too many environments and I have forgotten it myself.

Many online answers analyzed the reasons and said: The version of samtools is above 1.9, but the version of samtools installed by conda is still 1.7. So it is recommended to install version 1.9 mandatory:conda install -c bioconda samtools=1.9 --force-reinstall

This answer may work for some people. But in fact, conda is already over 1.9:conda search samtools
image.png

The version I installed is 1.10 by default, and this library is still missing. In short, there is still a mismatch in the version of the dependent library.

This issue has many issues on github, such as libtinfow.so.5

The developer recommends soft linking from elsewhere (downgrade).

For example, my samtools lacks libcrypto.so.1.0.0, libncurses.so.5, libtinfow.so.5.
First find the same dependent libraries of other software, and the soft link can be the above name.

find ./ -name "libtinfow*"
ln -s ../../predict/lib/libtinfow.so.6 libtinfow.so.5

image.png

Other missing libraries are similar, if they fail, you can try a few more. There is not much difference between adjacent versions.

ln -s libcrypto.so.1.1 libcrypto.so.1.0.0
ln -s /lib64/libbz2.so.1 /usr/lib64/libbz2.so.1.0


Read More:

Leave a Reply

Your email address will not be published. Required fields are marked *