Error while loading shared libraries

Issues related to applications and software problems and general support
Post Reply
Rudy23
Posts: 5
Joined: 2014/04/20 09:53:42

Error while loading shared libraries

Post by Rudy23 » 2022/05/10 19:35:29

I'm trying to start a game server (tes3mp server) on CentOS 8 and whenever I try to start it I get the following message:

Code: Select all

Loading server config from the package directory
./tes3mp-server.x86_64: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: No such file or directory
Does anyone know how to fix this?
Last edited by Rudy23 on 2022/05/10 20:35:59, edited 1 time in total.

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Error while loading shared libraries

Post by TrevorH » 2022/05/10 19:59:34

When you get an error like that you run e.g. yum provides '*/libluajit-5.1.so.2' which will tell you the package name that provides that file. Then you yum install it.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Rudy23
Posts: 5
Joined: 2014/04/20 09:53:42

Re: Error while loading shared libraries

Post by Rudy23 » 2022/05/10 20:33:32

Code: Select all

sudo yum provides '*/libluajit-5.1.so.2'
Last metadata expiration check: 2:42:14 ago on Tue 10 May 2022 07:50:20 PM CEST.
Error: No Matches found
Is it possible that there is no such library for CentOS 8?

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Error while loading shared libraries

Post by TrevorH » 2022/05/10 20:42:30

No, I missed the fact that the package that supplies that library is from the EPEL third party repo. So first, yum install epel-release then repeat the previous instructions.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Rudy23
Posts: 5
Joined: 2014/04/20 09:53:42

Re: Error while loading shared libraries

Post by Rudy23 » 2022/05/11 06:16:59

That has fixed the problem, thanks!

Now I have another issue:

Code: Select all

Loading server config from the package directory
./tes3mp-server.x86_64: error while loading shared libraries: libbz2.so.1.0: cannot open shared object file: No such file or directory
How do I find out which third party repository do I need and install it accordingly?

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Error while loading shared libraries

Post by TrevorH » 2022/05/11 06:38:53

Well you would run the same command as before but with the other library name in it. But I already did and nothing supplies that file for CentOS 8 though you can amend it and run yum provides '*/libbz2.so.*' which will tell you what package supplies something _similar_. You would then have to do something quite nasty to make it work like creating a symlink for the lib it wants to the one we supply. There's no guarantee that will work or if it does appear to work, that it does what you hope it does.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Rudy23
Posts: 5
Joined: 2014/04/20 09:53:42

Re: Error while loading shared libraries

Post by Rudy23 » 2022/05/11 06:50:47

Do you think that on CentOS 7 I would encounter the same problem?

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Error while loading shared libraries

Post by TrevorH » 2022/05/11 07:16:27

Yes, exactly the same. Nothing there supplies libbz2.so.1.0 either.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Error while loading shared libraries

Post by jlehtone » 2022/05/11 08:47:42

In both CentOS 7 and AlmaLinux 8 the package 'bzip2-libs' provides:

Code: Select all

Filename    : /usr/lib64/libbz2.so.1
Filename    : /usr/lib64/libbz2.so.1.0.6
One of them is symlink to the other:

Code: Select all

[CentOS 7]$ ll /usr/lib64/libbz2.so.1*
lrwxrwxrwx. 1 root root    15 Jan 14  2019 /usr/lib64/libbz2.so.1 -> libbz2.so.1.0.6
-rwxr-xr-x. 1 root root 68192 Nov 20  2015 /usr/lib64/libbz2.so.1.0.6
Package 'bzip2-devel' provides one more symlink:

Code: Select all

$ ll /usr/lib64/libbz2.so
lrwxrwxrwx. 1 root root 11 Jun 18  2019 /usr/lib64/libbz2.so -> libbz2.so.1
Usually when one compiles, the linker looks for the .so file and records the *.so.x in the binary.
For some reason your binary has been linked explicitly to *.so.x.y

Incidentally, I have a binary with that exact same dependency, so I have created an Ansible task:

Code: Select all

  - name: Link required by Pymol-script-repo dssp-2
    file:
      path: /usr/lib64/libbz2.so.1.0
      src: libbz2.so.1.0.6
      state: link
That is, I create symlink like TrevorH said:

Code: Select all

/usr/lib64/libbz2.so.1.0 -> /usr/lib64/libbz2.so.1.0.6
By logic that should be relatively safe, because /usr/lib64/libbz2.so.1.0.6 should be just one version of /usr/lib64/libbz2.so.1.0.z

Rudy23
Posts: 5
Joined: 2014/04/20 09:53:42

Re: Error while loading shared libraries

Post by Rudy23 » 2022/05/11 10:30:00

I managed to get it working by creating a symlink as you guys suggested. Thank you!

Post Reply