我正在尝试在 Ubuntu 18.04 系统上安装 Netezza Client。安装后我们检查了一下,发现出现了下面的错误信息
/usr/local/nz$ nzsql
nzsql: error while loading shared libraries: libcom_err.so.2: wrong ELF class: ELFCLASS64
我的诊断步骤:
查找共享库
/usr/local/nz$ ldd ./bin/nzsql linux-gate.so.1 (0xf7f13000) libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xf7ee0000) libkrb5.so.3 => /usr/local/nz/./bin/../lib/libkrb5.so.3 (0xf7e3a000) libcrypt.so.1 => /lib/i386-linux-gnu/libcrypt.so.1 (0xf7e08000) libssl.so.10 => /usr/local/nz/./bin/../lib/libssl.so.10 (0xf7da5000) libcrypto.so.10 => /usr/local/nz/./bin/../lib/libcrypto.so.10 (0xf7bf2000) libresolv.so.2 => /lib/i386-linux-gnu/libresolv.so.2 (0xf7bda000) libnsl.so.1 => /lib/i386-linux-gnu/libnsl.so.1 (0xf7bbf000) libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf7bba000) libncurses.so.5 => /lib/i386-linux-gnu/libncurses.so.5 (0xf7b94000) libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7a92000) libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf78b4000) libcom_err.so.3 => /usr/local/nz/./bin/../lib/libcom_err.so.3 (0xf78b1000) libk5crypto.so.3 => /usr/local/nz/./bin/../lib/../lib/libk5crypto.so.3 (0xf7882000) libkrb5support.so.0 => /usr/local/nz/./bin/../lib/../lib/libkrb5support.so.0 (0xf7879000) libgssapi_krb5.so.2 => /usr/local/nz/./bin/../lib/libgssapi_krb5.so.2 (0xf783e000) /lib/ld-linux.so.2 (0xf7f15000) libcom_err.so.2 => not found libtinfo.so.5 => /lib/i386-linux-gnu/libtinfo.so.5 (0xf781b000)
我看到了“未找到”消息
libcom_err.so.2 => not found
尝试安装包
/usr/local/nz$ sudo apt-get install libcomerr2 [sudo] password for ocmsapp: Reading package lists... Done Building dependency tree Reading state information... Done libcomerr2 is already the newest version (1.44.1-1ubuntu1.2). The following packages were automatically installed and are no longer required: linux-headers-4.15.0-65 linux-headers-4.15.0-65-generic linux-image-4.15.0-65-generic linux-modules-4.15.0-65-generic Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 36 not upgraded.
它说包已经在那里。
检查已安装的版本
:~$ dpkg --listfiles libcom-err2 /. /lib /lib/x86_64-linux-gnu /lib/x86_64-linux-gnu/libcom_err.so.2.1 /usr /usr/share /usr/share/doc /usr/share/doc/libcom-err2 /usr/share/doc/libcom-err2/changelog.Debian.gz /usr/share/doc/libcom-err2/copyright /lib/x86_64-linux-gnu/libcom_err.so.2
创建软链接
sudo ln -s /lib/x86_64-linux-gnu/libcom_err.so.2 libcom_err.so.2
然后我们再检查,
ldd ./bin/nzsql
仍然看到未找到的消息libcom_err.so.2 => not found
一旦我们尝试运行
nzsql
命令,我们就会收到以下消息/usr/local/nz$ nzsql nzsql: error while loading shared libraries: libcom_err.so.2: wrong ELF class: ELFCLASS64
可能存在什么问题?我该如何解决?
答案1
您应该通过运行来确认这一点
file /usr/local/nz/bin/nzsql
但您的 netazza 应用程序很可能是 x86-64(即 64 位)安装上的 32 位应用程序;您将需要安装 32 位版本的 libcomerr2,如下所示:
sudo apt install libcomerr2:i386
以及它所依赖的任何其他系统库。