samtools: error while loading shared libraries: libbz2.so.1.0: cannot open shared object file: No such file or directory
2
2
Entering edit mode
6.7 years ago
wschrein ▴ 20

Hi everyone. I keep getting this error message with samtools. I have used samtools in the past plenty of times. I am not sure how to solve it. Any help would be greatly appreciated.

samtools: error while loading shared libraries: libbz2.so.1.0: cannot open shared object file: No such file or directory

I have tried googling the error. Nothing specific with respect to samtools has come up. However, there were some fixes that I tried:

sudo yum install bzip2-devel sudo ln -s find /usr/lib64/ -type f -name "libbz2.so.1*" /usr/lib64/libbz2.so.1.0

However, it asks for a login when I try this fix or others.

RNA-Seq samtools • 29k views
ADD COMMENT
1
Entering edit mode
sudo yum install bzip2-devel

will ask for admin/sudo pass word because you are trying to install a package. If you are the administrator, furnish pass word and if you are not the administrator, request your administrator to install bzip2-devel or request him/her to give you sudo privileges.

Btw, did you check the version of bzip2-devel on the system, you have access to? If it doesn't exist, then one should do above step. If it is already existing, either you have to update or a simple soft linking (given below) should be enough. However you need root/sudo privileges to make any changes at system leve.

sudo `ln -s find /usr/lib64/ -type f -name "libbz2.so.1*"` /usr/lib64/libbz2.so.1.0

You are soft linking a file in root file system. Again, you need to furnish password to make system wide change.

ADD REPLY
0
Entering edit mode

Which version of samtools? Was it recently updated? Did you install samtools yourself? Are you the administrator of the computer?

ADD REPLY
0
Entering edit mode

It is version 1.5. I used bioconda to install samtools. I had used samtools successfully multiple times over the past few months. Suddenly, today I had this issue. I also updated samtools after this issue popped up and that did not seem to fix the issue

I am not the administrator. I have an account on a linux server, CentOS 6.6.

ADD REPLY
0
Entering edit mode

Is your problem solved? I also encountered the same problem.

ADD REPLY
0
Entering edit mode

+1 for static libraries

ADD REPLY
12
Entering edit mode
6.7 years ago
anthonycor ▴ 120

From https://github.com/bioconda/bioconda-recipes/pull/5049#issuecomment-311070184

bioconda now requires conda-forge and the conda-forge version of bzip2 uses shared libraries, while the one in the main channel uses a static library. Since it was compiled against the shared library version you need to also have than included in your environment. Hope this fixes it for you.

Try installing samtools with conda-forge included:

conda install -c conda-forge -c bioconda samtools bzip2

ADD COMMENT
1
Entering edit mode

I had a similar problem and this worked for me. Thanks.

ADD REPLY
0
Entering edit mode

Same here. What should the order be in my .condarc? Currently it's:

channels:
  - bioconda
  - r
  - defaults
  - conda-forge

Should this be reordered?

ADD REPLY
1
Entering edit mode

Put conda-forge second, after bioconda.

ADD REPLY
0
Entering edit mode

thank you for your help!

ADD REPLY
1
Entering edit mode
6.7 years ago

Try updating or installing bzip2 via conda. Until relatively recently the .so file wasn't included, so samtools (and everything else) needed to use whatever was installed on your system. If that doesn't work, ask the systems administrator to install libbz2, which they will likely be happy to do.

ADD COMMENT

Login before adding your answer.

Traffic: 2239 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6