[BUG] There is an executable file in the Linux directory, but it prompts that it cannot be found, "No such file or directory", solution: install the operating framework of 32-bit programs for 64-bit Ubuntu

question

insert image description here
I made an effort as follows:

  1. ls display; (can be successfully displayed)
  2. Modify the file name; (can be copied, modified, moved normally, and the copied one still cannot run)
  3. Adjust the file properties to make it 777;
  4. cat displays the files. (able to display successfully)
  5. root execution file; (file not found)
  6. Direct input repeat; (display no such command)
  7. Switch to another directory, and then execute with a relative path repeat; (file not found)
  8. Absolute path execution repeat; (file not found)
  9. exec: exec ./repeat; (file not found)
  10. Execute in another terminal: /bin/sh ./repeat; (report error)
  11. Changed a machine, it can run normally (indicating that it is not a problem with the file itself).

It's all metaphysical methods, and it doesn't work.

solve

Check the header of the file: readelf -h repeat;
insert image description here

It turns out that this is a 32-bit program, and running in 64-bit Ubuntu requires the installation of 32-bit libraries in advance.

First add the i32 architecture, then update the mirror source, and then install it. The instructions are as follows:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 -y
sudo apt install lib32z1 -y

Then it works! You can run! ! !

Guess you like

Origin blog.csdn.net/qq_46106285/article/details/124946919