cannot execute binary file 🐧 Linux

cannot execute binary file: Exec format error

The program was built for a different CPU architecture or OS — e.g. an x86_64 binary on an ARM machine (Raspberry Pi, Graviton, Apple Silicon VM).

Seen on: Linux

Meaning

The kernel can’t run machine code for another architecture. Downloading the wrong release asset (amd64 vs arm64), or a macOS/Windows binary on Linux, causes it.

Common causes

  • Wrong architecture download (amd64 on arm64 or vice versa)
  • macOS/Windows binary on Linux
  • 32-bit binary without 32-bit support
  • Corrupted or partial download (HTML error page saved as the binary)

⚡ Quick fix

  1. Check: uname -m and file ./binary
  2. Download the build for your architecture
  3. Re-download and verify the checksum

Detailed fix by platform

Linux

  1. bash
    uname -m
    file ./tool
    curl -LO https://example.com/releases/tool-linux-$(dpkg --print-architecture).tar.gz

How to diagnose

  1. Host arch — uname -m
  2. Binary — file ./tool output
  3. Download — Size/checksum correct?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.