error: /lib64/libpthread.so.0:

error: /lib64/libpthread.so.0: symbol h_errno_Li Shilong's Technology Blog_51CTO Blog

问题:ls: relocation error: /lib64/libpthread.so.0: symbol h_errno, version GLIBC_PRIVATE not defined in file libc.so.6 with link time referenc
1.


I use SSH to connect to a computer without root access. To install some software, I uploaded the libraries from my computer and put them in the ~/lib directory on the remote host.

Now, for almost every command I run, I get the following error (like ls) or a Segmentation fault (core dumped) message.

ls: relocation error: /lib64/libpthread.so.0: symbol h_errno, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference
1.


The only commands I have successfully run are cd and pwd until now. By using the TAB autocompletion ls I can almost find the file in the directory, so I can move around the directory.

uname -r also returns that Segmentation fault (core dumped) message, so I'm not sure which kernel version I'm using.

Since you can log in, it's no big deal. Presumably your shell's startup script adds ~/lib to LD_LIBRARY_PATH , and a bad library in ~/lib is causing the problem you're seeing.

To fix this, run

unset LD_LIBRARY_PATH #Temporary solution
1.


This will allow you to run rm, vim, etc. Remove troublesome libraries and edit your startup scripts, if appropriate.


The problem that arises:

ls: relocation error: /lib64/libpthread.so.0: symbol h_errno, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference
1.


A complete solution:

After login, copy and 
execute lib&lib64 according to the error path

vim /etc/profile #Permanent write

export LD_PRELOAD=/lib64/libpthread.so.0 
export LD_PRELOAD=/lib64/libc.so.6

or

export LD_PRELOAD=/lib/libpthread.so.0
export LD_PRELOAD=/lib/libc.so.6

source /etc/profile #effective


or

vim .bashrc #write

export LD_PRELOAD=/lib64/libpthread.so.0 
export LD_PRELOAD=/lib64/libc.so.6

or

export LD_PRELOAD=/lib/libpthread.so.0
export LD_PRELOAD=/lib/libc.so.6

source /etc/profile #effective
-----------------------------------
©Copyright belongs to the author: from 51CTO The author of the blog, I am not the original work of Jiu Ye, please contact the author for reprint authorization, otherwise legal responsibility will be pursued
error: /lib64/libpthread.so.0: symbol h_errno
https://blog.51cto.com/lwm666/2773648

おすすめ

転載: blog.csdn.net/m0_73016265/article/details/131042303