Score:1

How to Install GoLang on Ubuntu Server 20.04 LTS: Cannot Execute Binary File

in flag

I'm trying to install Golang on my raspberry pi running ubuntu server 20.04LTS and am having a lot of trouble. I could probably use advice on how to make sure I undo and uninstall any changes I made while attempting to install go-lang via snap and apt-get. I have successfully installed the package from tar.gz found at go.dev into the correct location /usr/local/ But no matter how many instructions I follow on exporting the path I always get this same error.

enter image description here

I have cleared out my path in order to prep for getting help

enter image description here

And I have extracted /go from the go.dev tar.gz file

enter image description here

Please I really could use some help with the appropriate installation procedure.

What is the correct method? snap or apt-get?

How are the variables actually supposed to be set?

How do I make sure I uninstall everything I did wrong and reinstall the right way ?

I have tried several times to compile it manually by unzipping from tar.gz but even when I try running ./go/bin/go directly I still get the error -bash: ./go/bin/go: cannot execute binary file: Exec format error

two commands I ran troubleshooting that Im not sure how to undo.. or if i need to.

sudo update-alternatives --set go /usr/local/go/bin/go

sudo update-alternatives --install "/usr/bin/go" "go" "/usr/local/go/bin/go" 0

T0adMomo avatar
in flag
20.04 LTS is the version I am running thank you for helping me clarify.
T0adMomo avatar
in flag
It is 20.04 LTS
N0rbert avatar
zw flag
Which guide do you follow? Why do you have `go` in `/usr/local/go/bin/go`? What is the output of `file /usr/local/go/bin/go`? What is the output of `arch`? What was wrong with official [deb-packages](https://packages.ubuntu.com/search?suite=focal&arch=any&mode=exactfilename&searchon=contents&keywords=bin%2Fgo)?
Score:1
zw flag

You have to remove wrongly manually installed Go executable by

sudo rm /usr/local/go/bin/go

and then install normal one from official repositories by:

sudo apt-get install golang-go
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.