LINUX 修复relocation error: /lib/tls/libc.so.6

27420阅读 0评论2013-04-07 tomsyan
分类:LINUX

今天在做HADOOP的时候,安装JDK 1.7需要libc-2.4以上的版本,本着试试的想法,
从其他机器上COPY了一个libc-2.5.so,然后对libc.so.6重新做了一个软连接,
这一搞导致系统基本不能用了,所有的命令都报:
relocation error: /lib/tls/libc.so.6: symbol _dl_tls_get_addr_soft, version GLIBC_PRIVATE not defined in file ld-linux.so.2 with link time reference.


破坏步骤比较简单:


[root@sxtest01 tls]# mv /tmp/libc-2.5.so  .
[root@sxtest01 tls]# ls -ltr
total 3552
-rwxr-xr-x  1 root root   32012 Jan 31  2007 libthread_db-1.0.so
-rwxr-xr-x  1 root root   50672 Jan 31  2007 librt-2.3.4.so
-rwxr-xr-x  1 root root  107800 Jan 31  2007 libpthread-2.3.4.so
-rwxr-xr-x  1 root root  213772 Jan 31  2007 libm-2.3.4.so
-rwxr-xr-x  1 root root 1529008 Jan 31  2007 libc-2.3.4.so  <--这个是老的
-rw-rw-r--  1 root root 1598712 Apr 11  2008 libc-2.5.so               <--这个是我新复制过来的
lrwxrwxrwx  1 root root      19 Jul 27  2008 libthread_db.so.1 -> libthread_db-1.0.so
lrwxrwxrwx  1 root root      14 Jul 27  2008 librt.so.1 -> librt-2.3.4.so
lrwxrwxrwx  1 root root      19 Jul 27  2008 libpthread.so.0 -> libpthread-2.3.4.so
lrwxrwxrwx  1 root root      13 Jul 27  2008 libm.so.6 -> libm-2.3.4.so
lrwxrwxrwx  1 root root      13 Jul 27  2008 libc.so.6 -> libc-2.3.4.so
drwxr-xr-x  3 root root    4096 Dec 22  2009 i686
drwxr-xr-x  2 root root    4096 Dec 22  2009 i586
drwxr-xr-x  2 root root    4096 Dec 22  2009 i486
[root@sxtest01 tls]# rm libc.so.6
rm: remove symbolic link `libc.so.6'? y
[root@sxtest01 tls]# ln -s libc-2.5.so libc.so.6  <--重新对 libc.so.6做了一个软连接
[root@sxtest01 tls]# ll
ls: relocation error: /lib/tls/libc.so.6: symbol _dl_tls_get_addr_soft, version GLIBC_PRIVATE not defined in file ld-linux.so.2 with link time reference
[root@sxtest01 tls]# ls -ltr
ls: relocation error: /lib/tls/libc.so.6: symbol _dl_tls_get_addr_soft, version GLIBC_PRIVATE not defined in file ld-linux.so.2 with link time reference
[root@sxtest01 tls]# ls -ltr
ls: relocation error: /lib/tls/libc.so.6: symbol _dl_tls_get_addr_soft, version GLIBC_PRIVATE not defined in file ld-linux.so.2 with link time reference
[root@sxtest01 tls]# ll
ls: relocation error: /lib/tls/libc.so.6: symbol _dl_tls_get_addr_soft, version GLIBC_PRIVATE not defined in file ld-linux.so.2 with link time reference
[root@sxtest01 tls]# rm libc.so.6
rm: relocation error: /lib/tls/libc.so.6: symbol _dl_tls_get_addr_soft, version GLIBC_PRIVATE not defined in file ld-linux.so.2 with link time reference
[root@sxtest01 tls]# mv libc.so.6 /tmp
mv: relocation error: /lib/tls/libc.so.6: symbol _dl_tls_get_addr_soft, version GLIBC_PRIVATE not defined in file ld-linux.so.2 with link time reference



这个时候最好不要重启OS,否则就麻烦了。

恢复步骤如下:


[root@sxtest01 tls]# export LD_PRELOAD=/lib/tls/libc-2.3.6.so
[root@sxtest01 tls]# ls -ltr
total 3552
-rwxr-xr-x  1 root root   32012 Jan 31  2007 libthread_db-1.0.so
-rwxr-xr-x  1 root root   50672 Jan 31  2007 librt-2.3.4.so
-rwxr-xr-x  1 root root  107800 Jan 31  2007 libpthread-2.3.4.so
-rwxr-xr-x  1 root root  213772 Jan 31  2007 libm-2.3.4.so
-rwxr-xr-x  1 root root 1529008 Jan 31  2007 libc-2.3.4.so
-rw-rw-r--  1 root root 1598712 Apr 11  2008 libc-2.5.so
lrwxrwxrwx  1 root root      19 Jul 27  2008 libthread_db.so.1 -> libthread_db-1.0.so
lrwxrwxrwx  1 root root      14 Jul 27  2008 librt.so.1 -> librt-2.3.4.so
lrwxrwxrwx  1 root root      19 Jul 27  2008 libpthread.so.0 -> libpthread-2.3.4.so
lrwxrwxrwx  1 root root      13 Jul 27  2008 libm.so.6 -> libm-2.3.4.so
drwxr-xr-x  3 root root    4096 Dec 22  2009 i686
drwxr-xr-x  2 root root    4096 Dec 22  2009 i586
drwxr-xr-x  2 root root    4096 Dec 22  2009 i486
lrwxrwxrwx  1 root root      11 Apr  7 13:48 libc.so.6 -> libc-2.5.so
[root@sxtest01 tls]# rm libc.so.6
rm: remove symbolic link `libc.so.6'? y
[root@sxtest01 tls]# ln -s /lib/tls/libc-2.3.4.so /lib/tls/libc.so.6

终于搞好了,虚惊了一场。

上一篇:运行sqoop 报 Could not find or load main class org.apache.sqoop.Sqoop
下一篇:dfs.data.dir 权限位导致DATANODE启动失败