If the library your program is looking for is not available in the server then ubuntu will throw an ‘Error while loading shared libraries’.

Here at Bobcares, we have seen several such Ubuntu related errors as part of our Server Management Services for web hosts and online service providers.

Today we’ll take a look at the causes for this error and see how to fix it.

 

What causes Ubuntu ‘Error while loading shared libraries’ to occur

This is one of the most common errors that we come across while installing a program.

The complete error message looks like the below one:

error while loading shared libraries:
cannot open shared object file: No such file or directory

Generally, when you run a program if the required library is not available then this error occurs in Ubuntu.

This error also appears after upgrading the Ubuntu version. This happens because few outdated libraries will be removed in the newer version if ubuntu. However, those libraries will be required to run your program on the server.

 

How we fix Ubuntu ‘Error while loading shared libraries’ error message

Here is an error message our customers received,

error while loading shared libraries: liblapacke.so.3: cannot open shared object file: No such file or directory

Now let’s see how our Support Engineers assist our customers in fixing this error message.

Initially, we find out in which this library is in. For that we run the below command,

apt-file search liblapacke.so.3

As a result, the output will be something like this,

liblapacke: /usr/lib/x86_64-linux-gnu/liblapacke.so.3

So, we now need to install the package.

sudo apt install liblapacke

Similarly, we need to install the package that is missing. This should fix the error.

[Need any further assistance in fixing Ubuntu errors? – We are here to help you.]

 

Conclusion

In short, this error occurs when the library your program is looking for is not available on the server. Today, we saw how our Support Engineers fix this error.