Solution to the "No such file or directory" prompt when executing executable files in Linux

Solution to the "No such file or directory" prompt when executing executable files in Linux

Recently, when I was using the Linux operating system to execute an executable file, a prompt "No such file or directory" appeared, which made me very confused.

./tshrf

bash: ./tshref: No such file or directory

Check the file information and you can see that the file exists and is executable.

-rwxr-xr-x 1 yuan yuan 20581 April 29 2004 tshref

After consulting the information, the reason is that the system bitness does not match the lib library bitness required by the executable file.

Use the uname command to print system information and find that the system is a 64-bit system

uname -a

Linux yuan-vm 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Use the file command to view the file information and find that it is a 32-bit executable file.

file ./tshref

./tshref: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), 
dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped

To run 32-bit programs on a 64-bit system, you need to install the 32-bit lib library.

For Ubuntu users, you can use the following command to install it.

sudo apt-get install ia32-libs

Reading package lists... Done
Building dependency tree    
Reading state information... Done
Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
 lib32z1 lib32ncurses5 lib32bz2-1.0

The required library may not be found during the process, but there will be several alternative packages. Choose to install one of them.

sudo apt-get install lib32bz2-1.0
lib32bz2-1.0

Then you can run the previous executable file normally.

There may be other reasons for this problem, such as text encoding format problems. This article only proposes a solution. Readers who encounter the same problem should analyze the specific problem.

This is the end of this article about how to solve the problem "No such file or directory" when executing executable files in Linux. For more information about Linux No such file or directory, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • There is no make command in Linux (make: *** No target specified and no makefile or make command installation method found)
  • Definition and use of makefile command packages in Linux
  • One shell command a day Linux text series - file command usage
  • Summary of Linux environment variable configuration methods (differences between .bash_profile and .bashrc)
  • Example analysis of the conversion between file descriptor fd and file pointer FILE* in Linux
  • Detailed explanation of Linux makefile and shell file calling each other
  • Use of Linux file command

<<:  How webpack implements static resource caching

>>:  Mysql8.0 uses window functions to solve sorting problems

Recommend

Introduction to useRef and useState in JavaScript

Table of contents 1. useState hook 2. useRef hook...

How MLSQL Stack makes stream debugging easier

Preface A classmate is investigating MLSQL Stack&...

Pay attention to the use of HTML tags in web page creation

HTML has attempted to move away from presentation...

MySQL incremental backup and breakpoint recovery script example

Introduction Incremental backup means that after ...

Linux type version memory disk query command introduction

1. First, let’s have a general introduction to th...

Detailed explanation of where the images pulled by docker are stored

The commands pulled by docker are stored in the /...

User-centered design

I've been asked a lot lately about an apparen...

Specific use of pthread_create in linux to create threads

pthread_create function Function Introduction pth...

A brief discussion on spaces and blank lines in HTML code

All consecutive spaces or blank lines (newlines) ...

Vue implements multi-tab component

To see the effect directly, a right-click menu ha...

CSS example code to hide the scroll bar and scroll the content

Preface When the HTML structure of a page contain...

Nexus uses API to operate

Nexus provides RestApi, but some APIs still need ...

Summary of basic usage of js array

Preface Arrays are a special kind of object. Ther...

Source code reveals why Vue2 this can directly obtain data and methods

Table of contents 1. Example: this can directly g...