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
- Check: uname -m and file ./binary
- Download the build for your architecture
- Re-download and verify the checksum
Detailed fix by platform
Linux
- bash
uname -m file ./tool curl -LO https://example.com/releases/tool-linux-$(dpkg --print-architecture).tar.gz
How to diagnose
- Host arch — uname -m
- Binary — file ./tool output
- 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:
Similar errors
- built for iOS, linking for simulator Building for iOS Simulator, but linking in object file built for iOS, for architecture arm64
- error while loading shared libraries error while loading shared libraries: libX.so.N: cannot open shared object file: No such file or directory
- exec format error exec /usr/local/bin/docker-entrypoint.sh: exec format error
Most viewed in Linux
Other ways to find it
🧠 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026