
我正在嘗試在 64 位元 Ubuntu 上運行 32 位元可執行檔。這裡是對情況的簡短概述。但我必須預先安裝 ia32 庫:
> aptitude search ia32
i ia32-libs - ia32 shared libraries for use on amd64 and ia64 syste
首先我測試了文件類型:
> file tipp10
tipp10: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.4, not stripped
我使用的是 64 位元 Oneric,帶有不太新的內核,因為我還沒有重新啟動它。
> uname -a
Linux christchurch 3.0.0-14-generic #23-Ubuntu SMP Mon Nov 21 20:28:43 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
正如我所說,正常執行不起作用。它因找不到檔案或目錄而中止。
> strace ./tipp10
execve("./tipp10", ["./tipp10"], [/* 46 vars */]) = -1 ENOENT (No such file or directory)
dup(2) = 3
fcntl(3, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE)
fstat(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0
[...]
這是我係統上的 ldd 輸出。在我的 64 位元 Debian 伺服器上,該程式被重新識別為動態連結程序,並且可以在輸出中看到一些庫引用。但在我的 Ubuntu 上:
> ldd tipp10
\tdas Programm ist nicht dynamisch gelinkt
# german for: "The programm is not linked dynamic"
我不明白發生了什麼事。
答案1
檢查您是否已正確安裝 libc6-i386;ENOENT
fromexecve
表示缺少動態連結器。