ファイルが存在し、PATHにあっても、「ファイルが見つかりません」というメッセージでLinux実行可能ファイルが失敗します。

ファイルが存在し、PATHにあっても、「ファイルが見つかりません」というメッセージでLinux実行可能ファイルが失敗します。

実行可能ファイル(バージョン2.12)を起動したいが、wine次のエラーが発生します($= shellプロンプト)。

$ wine
bash: /usr/bin/wine: No such file or directory
$ /usr/bin/wine
bash: /usr/bin/wine: No such file or directory
$ cd /usr/bin
$ ./wine
bash: ./wine: No such file or directory

ただし、ファイルは次のようになります。

$ which wine
/usr/bin/wine

実行ファイルは間違いなく存在し、死んだシンボリックリンクはありません。

$ stat /usr/bin/wine
  File: /usr/bin/wine
  Size: 9712            Blocks: 24         IO Block: 4096   regular file
Device: 802h/2050d      Inode: 415789      Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2017-07-13 13:53:00.000000000 +0200
Modify: 2017-07-08 03:42:45.000000000 +0200
Change: 2017-07-13 13:53:00.817346043 +0200
 Birth: -

32ビットELFです。

$ file /usr/bin/wine
/usr/bin/wine: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), 
dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, 
BuildID[sha1]=eaf6de433d8196e746c95d352e0258fe2b65ae24, stripped

実行可能ファイルの動的部分を取得できます。

$ readelf -d /usr/bin/wine
Dynamic section at offset 0x1efc contains 27 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libwine.so.1]
 0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000001d (RUNPATH)                    Library runpath: [$ORIGIN/../lib32]
 0x0000000c (INIT)                       0x7c000854
 0x0000000d (FINI)                       0x7c000e54
 [more addresses without file names]

ただし、以下を使用して共有オブジェクトの依存関係を一覧表示することはできませんldd

$ ldd /usr/bin/wine
/usr/bin/ldd: line 117: /usr/bin/wine: No such file or directory

strace示す:

execve("/usr/bin/wine", ["wine"], 0x7fff20dc8730 /* 66 vars */) = -1 ENOENT (No such file or directory)
fstat(2, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 4), ...}) = 0
write(2, "strace: exec: No such file or di"..., 40strace: exec: No such file or directory
) = 40
getpid()                                = 23783
exit_group(1)                           = ?
+++ exited with 1 +++

@jwwの提案を追加するように編集されました。ld処置: デバッグ・メッセージは生成されないため、動的リンク・ライブラリーが要求される前に問題が発生しているようです。

$ LD_DEBUG=all wine
bash: /usr/bin/wine: No such file or directory

可能な値だけを出力してもLD_DEBUGエラーが発生する

$ LD_DEBUG=help wine
bash: /usr/bin/wine: No such file or directory

@Raman Sailopalの提案を追加するように編集されました。/usr/bin/wineすでに作成されている別のファイルに内容をコピーすると同じエラーが発生するため、問題が実行可能ファイルにあるようです。

root:bin # cp cat testcmd    

root:bin # testcmd --help
Usage: testcmd [OPTION]... [FILE]...
Concatenate FILE(s) to standard output.
[rest of cat help page]

root:bin # dd if=wine of=testcmd  
18+1 records in
18+1 records out
9712 bytes (9.7 kB, 9.5 KiB) copied, 0.000404061 s, 24.0 MB/s

root:bin # testcmd
bash: /usr/bin/testcmd: No such file or directory

何が問題であり、見つからないファイルやディレクトリを見つけるにはどうすればよいですか?


uname -a:

Linux laptop 4.11.3-1-ARCH #1 SMP PREEMPT Sun May 28 10:40:17 CEST 2017 x86_64 GNU/Linux

ベストアンサー1

これ:

$ file /usr/bin/wine
/usr/bin/wine: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), 
dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, 
BuildID[sha1]=eaf6de433d8196e746c95d352e0258fe2b65ae24, stripped

これと組み合わせると:

$ ldd /usr/bin/wine
/usr/bin/ldd: line 117: /usr/bin/wine: No such file or directory

/lib/ld-linux.so.2システムにELFソルバーがないことをお勧めします。つまり、この64ビットシステムには32ビット互換ライブラリがインストールされていません。したがって、@user1334609の答えは基本的に正しいです。

おすすめ記事