0

我很困惑为什么libiconv.so.2并且libcharset.so.1两者都没有找到,但只有当我对不同的用户使用 sudo 时。LD_LIBRARY_PATH 完全相同,因为我使用 -E 运行 sudo:

$ ldd `which git`
    linux-vdso.so.1 =>  (0x00007fff51975000)
    libz.so.1 => /usr/lib64/libz.so.1 (0x0000003e60600000)
    libiconv.so.2 => /internal/lib/libiconv.so.2 (0x00007f0962bdd000)
    libcrypto.so.6 => /lib64/libcrypto.so.6 (0x0000003e6a400000)
    libcharset.so.1 => /internal/lib/libcharset.so.1 (0x00007f09629db000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003e61600000)
    libc.so.6 => /lib64/libc.so.6 (0x0000003e60a00000)
    libdl.so.2 => /lib64/libdl.so.2 (0x0000003e61200000)
    /lib64/ld-linux-x86-64.so.2 (0x0000003e60200000)
$ sudo -ucgaadm -EH ldd `which git`
    linux-vdso.so.1 =>  (0x00007fff5b148000)
    libz.so.1 => /usr/lib64/libz.so.1 (0x0000003e60600000)
    libiconv.so.2 => not found
    libcrypto.so.6 => /lib64/libcrypto.so.6 (0x0000003e6a400000)
    libcharset.so.1 => not found
    libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003e61600000)
    libc.so.6 => /lib64/libc.so.6 (0x0000003e60a00000)
    libdl.so.2 => /lib64/libdl.so.2 (0x0000003e61200000)
    /lib64/ld-linux-x86-64.so.2 (0x0000003e60200000)

只需检查 LD_LIBRARY_PATH,似乎 libiconv.so.2 的路径确实存在:

$ echo $LD_LIBRARY_PATH
...
$ sudo -ucgaadm -EH echo $LD_LIBRARY_PATH
... same output as previous command ...

从我的常规使用以及 sudo 用户中也可以看到应该包含这些库的目录:

$ ls /internal/lib/ -lah
total 2.5M
drwxr-xr-x 2 apsg apsggrp 4.0K Jan 31  2010 .
drwxr-xr-x 6 apsg apsggrp 4.0K Jan 31  2010 ..
-rw-r--r-- 1 apsg apsggrp  212 Jan 31  2010 charset.alias
-rw-r--r-- 1 apsg apsggrp  24K Jan 31  2010 libcharset.a
-rw-r--r-- 1 apsg apsggrp  993 Jan 31  2010 libcharset.la
lrwxrwxrwx 1 apsg apsggrp   19 Jan 31  2010 libcharset.so -> libcharset.so.1.0.0
lrwxrwxrwx 1 apsg apsggrp   19 Jan 31  2010 libcharset.so.1 -> libcharset.so.1.0.0
-rw-r--r-- 1 apsg apsggrp  24K Jan 31  2010 libcharset.so.1.0.0
-rw-r--r-- 1 apsg apsggrp  969 Jan 31  2010 libiconv.la
lrwxrwxrwx 1 apsg apsggrp   17 Jan 31  2010 libiconv.so -> libiconv.so.2.5.0
lrwxrwxrwx 1 apsg apsggrp   17 Jan 31  2010 libiconv.so.2 -> libiconv.so.2.5.0
-rw-r--r-- 1 apsg apsggrp 1.2M Jan 31  2010 libiconv.so.2.5.0
-rw-r--r-- 1 apsg apsggrp 1.2M Jan 31  2010 preloadable_libiconv.so
$ sudo -ucgaadm -EH ls /internal/lib/ -lah
... same output as previous command ...
4

1 回答 1

0

尝试“sudo su -”然后运行您的命令“-”更改为 root 用户并创建一个新的 shell。

于 2012-11-30T19:36:34.067 回答