如何解决这个丢失的库问题? 在这种情况下,我使用的是Sunfreeware软件包,而不是从源代码编译。
$ /usr/local/ssl/bin/openssl version
ld.so.1: openssl: fatal: libgcc_s.so.1: open failed: No such file or directory
Killed
$ ldd /usr/local/ssl/bin/openssl
libssl.so.1.0.0 => /usr/local/ssl/lib/libssl.so.1.0.0
libcrypto.so.1.0.0 => /usr/local/ssl/lib/libcrypto.so.1.0.0
libsocket.so.1 => /lib/libsocket.so.1
libnsl.so.1 => /lib/libnsl.so.1
libdl.so.1 => /lib/libdl.so.1
libc.so.1 => /lib/libc.so.1
libgcc_s.so.1 => (file not found)
libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1
libmp.so.2 => /lib/libmp.so.2
libmd.so.1 => /lib/libmd.so.1
libscf.so.1 => /lib/libscf.so.1
libdoor.so.1 => /lib/libdoor.so.1
libuutil.so.1 => /lib/libuutil.so.1
libgen.so.1 => /lib/libgen.so.1
libm.so.2 => /lib/libm.so.2
---更多信息---
$ uname -a
SunOS sunws04 5.10 Generic_144489-04 i86pc i386 i86pc
$ pkginfo -l SMCossl
PKGINST: SMCossl
NAME: openssl
CATEGORY: application
ARCH: x86
VERSION: 1.0.0d
BASEDIR: /usr/local
VENDOR: The OpenSSL Group
PSTAMP: Steve Christensen
INSTDATE: Jun 02 2011 12:20
EMAIL: steve@smc.vnet.net
STATUS: completely installed
FILES: 1864 installed pathnames
1 shared pathnames
43 directories
32 executables
28209 blocks used (approx)
$ echo $LD_LIBRARY_PATH
$ grep libgcc_s.so.1 /var/sadm/install/contents
/usr/local/lib/libgcc_s.so=libgcc_s.so.1 s none SMCgcc SMClgcc346
/usr/local/lib/libgcc_s.so.1 f none 0644 bin bin 158940 21764 1160370299 SMCgcc SMClgcc346
$ ldd -s /usr/local/ssl/bin/openssl
...
find object=libgcc_s.so.1; required by openssl
search path=/usr/local/ssl/lib (RPATH from file openssl)
trying path=/usr/local/ssl/lib/libgcc_s.so.1
search path=/lib:/usr/lib (default)
trying path=/lib/libgcc_s.so.1
trying path=/usr/lib/libgcc_s.so.1
libgcc_s.so.1 => (file not found)
...
find object=libgcc_s.so.1; required by /usr/local/ssl/lib/libssl.so.1.0.0
search path=/usr/local/lib:/usr/local/ssl/lib (RPATH from file /usr/local/ssl/lib/libssl.so.1.0.0)
trying path=/usr/local/lib/libgcc_s.so.1
libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1
---蹩脚的解决方法---
$ setrpath /usr/local/ssl/bin/openssl /usr/local/lib
Old RPATH: /usr/local/ssl/lib
New RPATH set to: /usr/local/lib
$ /usr/local/ssl/bin/openssl version
ld.so.1: openssl: fatal: libssl.so.1.0.0: open failed: No such file or directory
Killed
$ export LD_LIBRARY_PATH=/usr/local/ssl/lib
$ /usr/local/ssl/bin/openssl version
OpenSSL 1.0.0d 8 Feb 2011
---另一次尝试失败---
$ unset LD_LIBRARY_PATH
$ setrpath /usr/local/ssl/bin/openssl /usr/local/lib:/usr/local/ssl/lib
Old RPATH: /usr/local/lib
New RPATH would be longer than current RPATH.
(Use -f to use any extra space in string table)
$ setrpath -f /usr/local/ssl/bin/openssl /usr/local/lib:/usr/local/ssl/lib
Old RPATH: /usr/local/lib
New RPATH set to: /usr/local/lib:/usr/local/ssl/lib
$ /usr/local/ssl/bin/openssl version
ld.so.1: openssl: fatal: relocation error: file openssl: symbol /local/ssl/lib: referenced symbol not found
Killed
答案 0 :(得分:3)
或
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/csw/lib:/usr/local/lib:/usr/sfw/lib
export LD_LIBRARY_PATH
/ etc / profile 中的
库的正确顺序 - 路径对所有程序都起作用。
检查以下功能:
ldd /usr/local/ssl/bin/openssl
libssl.so.1.0.0 => /usr/local/ssl/lib/libssl.so.1.0.0
libcrypto.so.1.0.0 => /usr/local/ssl/lib/libcrypto.so.1.0.0
libsocket.so.1 => /lib/libsocket.so.1
libnsl.so.1 => /lib/libnsl.so.1
libdl.so.1 => /lib/libdl.so.1
libc.so.1 => /lib/libc.so.1
libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1
libmp.so.2 => /lib/libmp.so.2
libmd.so.1 => /lib/libmd.so.1
libscf.so.1 => /lib/libscf.so.1
libdoor.so.1 => /lib/libdoor.so.1
libuutil.so.1 => /lib/libuutil.so.1
libgen.so.1 => /lib/libgen.so.1
libm.so.2 => /lib/libm.so.2
/lib/libm/libm_hwcap1.so.2
/platform/SUNW,SPARC-Enterprise/lib/libc_psr.so.1
答案 1 :(得分:2)
或者你可以:
ln -s /usr/local/lib/libgcc_s.so.1 /usr/lib/libgcc_s.so.1
适合我:)
# /usr/local/ssl/bin/openssl version
OpenSSL 1.0.0d 8 Feb 2011
答案 2 :(得分:1)
我和sudo有同样的问题。我试过,没有运气。我实际上已经准备好安装补丁来纠正这个问题了。然后我发现我使用的是从sunfreeware.com下载的两个不同版本的sudo包。 1.8.1p2对1.8.3p2。我删除了文件,调出了新文件并且很好。我知道这个答案听起来很愚蠢,但是大约一个星期左右我没有得到答案,只是发现这是我的不好。