英文:
Go Mod Download on Raspberry Pi4
问题
我在运行以下命令时遇到了“无法执行二进制文件: 执行格式错误”的问题:
go mod download github.com/cih-y2k/wedeploy-gosocketio
我已经删除并重新下载了必要的目录,但问题仍未解决。
这是否意味着我需要下载另一种语言才能执行该文件?
谢谢!
英文:
Am running into a "cannot execute binary file: Exec format error" when running the following command from the below repository:
go mod download github.com/cih-y2k/wedeploy-gosocketio
<https://github.com/kuoyaoming93/guardian-mainnet-guide/blob/master/docs/COMPILE_ARM64.md#install-guardian-node-from-source-code>
Have deleted and re-downloaded the necessary directories, wasn't the solution.
Does this mean I need to download another language for this file to execute?
Thank you!
答案1
得分: 2
我的建议是按照提到的所有步骤来使用arm64架构的theta,否则你可能会使用来自其他架构(如amd64
)的二进制文件。
我在我的树莓派上进行了快速检查,没有报告任何问题,因为go.mod
文件已被替换为一个带有正确分支的新文件。
最后,cannot execute binary file: Exec format error
表示你正在使用与当前主机架构不匹配的二进制文件,即arm64
。
pi@raspberrypi ~/go/src/github.com/thetatoken/theta release sed 's/v0.0.0-20200107021104-147ed25f233e/v0.0.0-20220216073600-600054663ec1/' go.mod > aux_file
pi@raspberrypi ~/go/src/github.com/thetatoken/theta release
pi@raspberrypi ~/go/src/github.com/thetatoken/theta release sed 's/github.com\/wedeploy\/gosocketio v0.0.7-beta/github.com\/cih-y2k\/wedeploy-gosocketio v0.0.8/' aux_file > aux_file2
pi@raspberrypi ~/go/src/github.com/thetatoken/theta release
pi@raspberrypi ~/go/src/github.com/thetatoken/theta release rm go.mod
pi@raspberrypi ~/go/src/github.com/thetatoken/theta release ± cp aux_file2 go.mod
pi@raspberrypi ~/go/src/github.com/thetatoken/theta release ± rm aux_file aux_file2
pi@raspberrypi ~/go/src/github.com/thetatoken/theta release ± go mod download github.com/cih-y2k/wedeploy-gosocketio
pi@raspberrypi ~/go/src/github.com/thetatoken/theta release ±
由于树莓派是基于Linux的,你可以使用以下命令来验证架构:
pi@raspberrypi ~ arch ; uname -m
armv6l
armv6l
还应该检查Go环境:
pi@raspberrypi ~ go env | grep -i ARCH
GOARCH="arm"
GOHOSTARCH="arm"
英文:
My recommendation is to follow all the steps mentioned to use theta with arm64, otherwise you could be using the binaries from another arch like amd64
.
I did a quick check in my raspberry and no problem reported, since the go.mod
file has been replaced. with a new one with correct branches.
Finally, cannot execute binary file: Exec format error
means that you are using binaries that doesn't match with the current host architecture, in this case arm64
.
pi@raspberrypi ~/go/src/github.com/thetatoken/theta release sed 's/v0.0.0-20200107021104-147ed25f233e/v0.0.0-20220216073600-600054663ec1/' go.mod > aux_file
pi@raspberrypi ~/go/src/github.com/thetatoken/theta release
pi@raspberrypi ~/go/src/github.com/thetatoken/theta release sed 's/github.com\/wedeploy\/gosocketio v0.0.7-beta/github.com\/cih-y2k\/wedeploy-gosocketio v0.0.8/' aux_file > aux_file2
pi@raspberrypi ~/go/src/github.com/thetatoken/theta release
pi@raspberrypi ~/go/src/github.com/thetatoken/theta release rm go.mod
pi@raspberrypi ~/go/src/github.com/thetatoken/theta release ± cp aux_file2 go.mod
pi@raspberrypi ~/go/src/github.com/thetatoken/theta release ± rm aux_file aux_file2
pi@raspberrypi ~/go/src/github.com/thetatoken/theta release ± go mod download github.com/cih-y2k/wedeploy-gosocketio
pi@raspberrypi ~/go/src/github.com/thetatoken/theta release ±
Since raspberry is Linux based you can use the following to verify the arch:
pi@raspberrypi ~ arch ; uname -m
armv6l
armv6l
Go Env is also a check you should do:
pi@raspberrypi ~ go env | grep -i ARCH
GOARCH="arm"
GOHOSTARCH="arm"
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论