You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Oracle镜像中执行二进制文件遇Exec format error问题求助

解决aarch64实例执行x86-64 geth二进制的"Exec format error"问题

问题根源

你的Oracle Ampere实例是aarch64(ARM64)架构,但当前的geth二进制是为x86-64(AMD64)架构编译的——从file geth输出里的x86-64和interpreter /lib64/ld-linux-x86-64.so.2可以明确这点。这两种CPU指令集完全不兼容,直接执行必然报错,和系统更新状态无关,也不是二进制损坏(WSL是x86-64架构所以能正常运行)。

解决方案

1. 下载对应aarch64架构的预编译geth

获取官方提供的ARM64版本预编译二进制包,通常文件名会包含arm64或aarch64标识。解压后得到的geth即可直接在你的实例上执行。

2. 从源码编译适配aarch64的geth

如果找不到合适版本的预编译包,可自行编译:

  • 先安装编译依赖:
    dnf install golang git gcc make -y
    
  • 克隆go-ethereum仓库:
    git clone https://github.com/ethereum/go-ethereum.git
    
  • 进入仓库目录编译geth:
    cd go-ethereum
    make geth
    
  • 编译完成后,二进制文件位于build/bin/geth,可直接执行,也可复制到/usr/local/bin方便全局调用。

3. 临时方案:用QEMU模拟x86-64环境(不推荐)

仅适合临时测试,性能损耗极大,不适合长期使用:

  • 安装QEMU:
    dnf install qemu-user-static -y
    
  • 执行geth:
    qemu-x86_64-static ./geth
    

内容的提问来源于stack exchange,提问作者jypay Guy

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.28 06:42:15