Getting cp: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory error - centos

I'm getting below error in centOS. This started happens when in /lib64/ I renamed libc.so.6 as libc.so.6.backup. Now I'm unable to do anything on VM. None of cp, ls and no other commands are working. Please help me to get this fixed.
cp: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
grep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory

You really should not try to replace glibc on a system, expect by upgrading it to a version supplied by the distribution, using the distribution package manager.
That being said, on CentOS systems, /usr/sbin/sln is statically linked and can be used to add a symbolic link, with something like this:
/usr/sbin/sln /lib64/libc.so.6 /lib64/libc.so.6.backup

Related

cmake: error while loading shared libraries: librhash.so.0: cannot open shared object file: no such file or directory

After adding cmake_3.13 in yocto, getting error as
cmake: error while loading shared libraries: librhash.so.0: cannot open shared object file: no such file or directory.
Can anyone help me?

Kubernetes Pod - External library dependency

I'm using the Vault's Kubernetes Helm Chart.
Before proceeding, I'd like to mention that my issue is extremely similar to this one, but it didn't help.
So, inside Vault, I need to load a custom plugin, which has two dependencies: libpbc and libgmp.
While trying to install the plugin, I get this error:
* fork/exec /vault/plugins/plugin_name: no such file or directory
which is not normal, for the simple reason that everything seems okay (the plugin_directory (a Vault dependency) exists, the plugin is indeed under /vault/plugins etc).
So, by investigating, I found out that there is a big issue.
Executing ldd /vault/plugins/*plugin_name*, I get:
Error loading shared library libpbc.so.1: No such file or directory (needed by vault/plugins/plugin_name)
Error loading shared library libgmp.so.10: No such file or directory (needed by vault/plugins/plugin_name)
libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7eff0c4ba000)
libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7eff0c4ba000)
Error relocating vault/plugins/plugin_name: pbc_param_init_a1_gen: symbol not found
Error relocating vault/plugins/plugin_name: pbc_param_init_e_gen: symbol not found
Error relocating vault/plugins/plugin_name: pbc_cm_search_d: symbol not found
...
What I have already tried:
Moving the libraries inside the pod and under /usr/local/lib. No. Error: tar: can't create symlink 'libpbc.so' to 'libpbc.so.1.0.0': Permission denied
Moving the libraries "anywhere" and exporting the LD_LIBRARY_PATH. Again, no. Not working (Expected)
Any other thing that came to my mind and got me a "Permission denied" error.
Issue solved.
I created a custom Vault image and in the Dockerfile I made it to include all the dependencies
RUN apk add build-base gmp-dev ...
For the libpbc, I wget the files, decompress them and then
./configure
make
make install

pyinstaller Adafruit DHT library raspberry_Pi_Driver.so: cannot open shared object

I'm using Adafruit_DHT library in a file and when I try to use pyinstaller to compile, I get an error that Raspberry_Pi_Driver.so: cannot open shared object file
I'm using normal RPi (not model 2) and raspbian. The file that I'm trying to compile works by itself fine. The Raspberry_Pi_Driver.so is there I did find ./ | grep Raspberry_Pi_Driver.so and it existed. I tried also to use the --hidden-import=Adafruit_DHT when compiling the pyinsatller and that did not work too. When compiling it does not give any error.
I noticed after compilation and in the build folder thee is an Adafruit_DHT folder that has the driver and etc.
Any idea what's going on? Could it be that the library has been recreated under build folder and this is confusing when executing the file?
I found a resolution for this (thanks to: k4ml.me/posts/pyinstaller.html) I just added '-p /path/to/mylib' when creating the exe file and mylib was the directory that Adafruit_DHT folder was (that Adafruit_DHT_Driver.so file was there).

netbeans cannot open shared library during RUN comm

everything worked fine but I've just tried to run my CUDA programs on Linux Ubuntu 12.10 in NetBeans and I get error:
dist/Debug/GNU-Linux-x86/my_cuda_1: error while loading shared
libraries: libcudart.so.5.0: cannot open shared object file: No such
file or directory
RUN FAILED (exit value 127, total time: 191ms)
the projects can build: compile + link without problems, I can also run it from commandline but if I try run it from NetBeans I get this error.
I was able to run it few minutes ago, what might happened?
I have added file my_lib to ld.so.conf.d containing such text:
/usr/local/cuda-5.0/lib64:/lib
/usr/lib
/usr/lib64
can it be a link issue libcudart.so.5.0 -> licudart.so?
there are two libs in cuda/lib libcudart.so.5.0 (link) and libcudart.so (link) and libcudart.so.5.0.35 (shared lib)
why it complains about .so.5.0? mayve link like:
sudo ln -s /usr/lib/x86_64-linux-gnu/libglut.so.3 /usr/lib/libglut.so
is necessary
it is related to link to shared library I think
root#comp:# echo $LD_LIBRARY_PATH
/usr/lib/nvidia-current:/usr/local/cuda-5.0/lib::/usr/local/cuda-5.0/lib64:/lib
isn't this :: a problem? seems that No because I changed this and still same error. I specify PATHS, I run ldconfig, I put exports in the .bashrc, still nothing.
the reason is that I cannot load these libraries if program is started from NetBeans GUI, however I start NetBeans as root always
add to the Project -> Properties -> Run -> Environment
Name: LD_LIBRARY_PATH
Value:
$LD_LIBRARY_PATH:/usr/lib/nvidia-current:/usr/local/cuda-5.0/lib:/usr/local/cuda-5.0/lib64:/lib
Thank you all. I don't know what happened before as it worked just fine.

Compiling android native app calling ndk-build from eclipse, on ubuntu

On ubuntu 11.10 I installed eclipse from repositories, installed adt and cdt plugins. I am able to compile the hello-jni example using command line, but i would like to use eclipse for the task.
I followed the guide here: http://mhandroid.wordpress.com/2011/01/23/using-eclipse-for-android-cc-development/ and defined a PATH variable in eclipse preferences (window->preferences->c/c++->environment), pointing to the ndk-r7b folder. But the project won't buid. I get this error:
(Cannot run program "ndk-build"
(in directory "/home/athos/android/ndk-r7b/samples/hello-jni"):
java.io.IOException:
error=2, File o directory non esistente)
(last line should be "no such file or directory" in english)
If I specify "${PATH}/ndk-build" or "/home/athos/android/ndk-r7b/ndk-build" as the build command. i get this:
/home/lavoro/android/ndk-r7b/ndk-build
ERROR: Cannot find 'make' program. Please install Cygwin make package
/home/lavoro/android/ndk-r7b/ndk-build: 40: dirname: not found
or define the GNUMAKE variable to point to it.
If I define the GNUMAKE variable in window->preferences->c/c++->environment i get this:
ERROR: Your GNUMAKE variable is defined to an invalid name: /usr/bin/make
Please fix it to point to a valid make executable (e.g. /usr/bin/make)
Which is funny, since It suggests the exact same directory I indicated. Make is installed and present at the indicated location.
What am I missing?
It's a bit ugly, but you can always put
/fully/qualified/path/to/ndk-build
In your build command.