I've built WebP utilities on Ubuntu 14.04 following these instructions found at the official website of WebP. As I've done everything successfully, my system should let me compress and decompress images using cwebp and dwebp utilities respectively. But, whenever I try to compress/decompress any image, the system gives me this error bellow,

cwebp: error while loading shared libraries: libwebp.so.6: cannot open shared object file: No such file or directory

I guess, that page also describes my problem and solution to that as bellow,

"The library will usually be installed under the /usr/local/lib/ directory. To avoid run-time errors, make sure that your LD_LIBRARY_PATH environment variable includes this location."

I tried to add /usr/local/lib to my LD_LIBRARY_PATH environment variable in this way. But it's still giving me that error.

What should I do now?

However, I've also downloaded the prebuilt binaries from here. This binaries are working. But, for running those binaries, I've to go to the directory of that binaries or have to write path/to/the/binaries/./cwebp everytime. I'd also be helped, if I know how to install these prebuilt binaries on Ubuntu.

1 Answer 1


With the help of some members of Full Circle Magazine's official Telegram group, I've solved this problem successfully.

I've faced this problem, because my LD_LIBRARY_PATH environment variable didn't include /usr/local/lib. To add /usr/local/lib to LD_LIBRARY_PATH environment variable, run the command bellow,

$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

This will add the location /usr/local/lib to your LD_LIBRARY_PATH environment variable. To check that you've done this successfully, run this command,


This command should show you this result, :/usr/local/lib

NB: You've to do this everytime after you've started a new Terminal session. If you don't want to do it again and again, run the command bellow,

$ echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib" >> ~/.bashrc

This will add a new line containing export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib to the .bashrc file in the home directory.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .