Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

error
ubuntu
solution
binary
architecture

Error: cannot execute binary file

Anusheh Zohair Mustafeez

When running a file, your shell will display the cannot execute binary file error or exec format error if Linux fails to recognize the file as a shell script or executable file. This error typically occurs when a binary file for a certain processor architecture is run on a different architecture e.g., an x86 executable is run on an ARM CPU.

A binary file

Solution

We can solve this issue by figuring out what our machine’s architecture is with the command below:

uname -a

Next, we will run the following command to check the executable file’s architecture:

file filename

This gives us better insight into which architecture we require. For instance,​ if we are working on 32-bit Linux and the executable file requires a 64-bit architecture, we could download a 64-bit virtual machine to run the file.

RELATED TAGS

error
ubuntu
solution
binary
architecture

CONTRIBUTOR

Anusheh Zohair Mustafeez
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring