0

I have to install an .so library to a directory in my home directory because I'm not sudo user. I've created the env variable LD_LIBRARY_PATH=/home/<user>/lib/. I have created a directory /home/<user>/lib and I've copied the file libXss.so.1.0.0 and created a sym link to it called libXss.so.1 in that directory but when I launch the program that depends on that library it gives me the error:

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

4
  • How exactly did you "put the two files" in the directory? normally, libXss.so.1 would be a symbolic link to libXsso.so.1.0.0 I think (rather than a separate file) May 21, 2020 at 15:49
  • I simply copied the two file in the directory May 21, 2020 at 16:01
  • I am convinced the system won't link those libraries if the system has a version of them, which will take precedence. Regardless your methodology looks sound. It does look like the command line you show is lacking a bit of text /home/<user>/lib/... as opposed to /home//lib/ which would not match to ~/lib of any user, although I suspect this was not what you typed.
    – Pedro
    May 21, 2020 at 16:41
  • I've edited the question after I've did the step in the first answer, now should be more clear May 22, 2020 at 8:19

1 Answer 1

2

libXss.so.1 is a symlink and it seems you copied it as a file:

Try this:

$ rm /home/<my_username>/lib/libXss.so.1
$ ln -s /home/<my_username>/lib/libXss.so.1.0.0 /home/<my_username>/lib/libXss.so.1
$ LD_LIBRARY_PATH=/home/<my_username>/lib/ /path/to/your/program
10
  • I've did the step and now the error is: error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory May 22, 2020 at 8:14
  • @AndreaBellizzi, what is the output of file /home/<my_username>/lib/libXss.so* May 22, 2020 at 13:26
  • /home/andreabelliz/lib/libXss.so.1: symbolic link to `libXss.so.1.0.0' /home/andreabelliz/lib/libXss.so.1.0.0: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[sha1]=e375c9284e3378de2c6f1cdf7ccfae50db33220f, stripped May 22, 2020 at 15:36
  • The error message in the first comment point to the loader not being able to find the shared library... What system are you on? You may have other restrictions if you are running something embebbed for example. May 22, 2020 at 16:00
  • I'm on CentOS 7 system, other the fact that I'm not sudo user I don't know if I have other restriction. May 25, 2020 at 7:18

You must log in to answer this question.

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