Error while loading shared libraries: libbz2.so.1.0: cannot open shared object file on CentOS 7

Whilst trying to build using electron-builder on CentOS 7, I ran into the following error message:

error while loading shared libraries: libbz2.so.1.0: cannot open shared object file

To fix it, you’ll need to install bzip2-devel, and potentially create a symlink too as libbz2.so.1 exists, but libbz2.so.1.0 doesn’t

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

Michael is a polyglot software engineer, committed to reducing complexity in systems and making them more predictable. Working with a variety of languages and tools, he shares his technical expertise to audiences all around the world at user groups and conferences. You can follow @mheap on Twitter

Thoughts on this post

Rui 2017-06-30

Thank you!!! 😀

Sean Sanker 2017-07-10

This helped a lot. Thanks!

Evandro Grezeli 2017-11-01

Thanks!!!

Karanvir Singh 2018-03-06

Thank you!

pawel 2018-06-18

Hello!

I use ubuntu 18.04

I have tried
sudo apt-get install bzip2-devel
but I got
E: Unable to locate package bzip2-devel

I cant find any answers in google.

Can you help with it?

Michael Heap 2018-06-18

It looks as though the correct package for Ubuntu is libbz2-dev

Leave a comment?

Leave a Reply