gerbreown
Posts: 1
Joined: Thu Feb 12, 2015 2:02 pm

Raspberry Pi 4 and Golang

Fri Oct 18, 2019 10:26 am

Greetings:

I have just started using a Raspberry Pi 4, 4gb. I tried installing the Golang software on it and when I try to execute "go version" or any other "go command" I get the following error message: "bash: /usr/local/go/bin/go: cannot execute binary file: Exec format error"

This works fine on my Raspberry Pi3 but NOT 4.

Has the Golang not been upgraded for 4 yet or is there some other way I need to install it to get it to work on 4?

Thanks,

Gerald S. Brown

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26825
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspberry Pi 4 and Golang

Fri Oct 18, 2019 10:36 am

I just did

Code: Select all

sudo apt install golang
and it seemed to work fine.

$go version
go version go1.11.6 linux/arm
$
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

pagenotfound
Posts: 123
Joined: Mon Mar 14, 2016 12:44 pm

Re: Raspberry Pi 4 and Golang

Sat Oct 19, 2019 12:54 pm

Sounds like you tried to install Windows binaries. Uninstall them, then do what jamesh recommended.

Kendek
Posts: 263
Joined: Thu Jul 25, 2019 4:39 pm
Location: Kaposvár, Hungary

Re: Raspberry Pi 4 and Golang

Sat Oct 19, 2019 1:50 pm

Or if you want a newer version, just use the precompiled armv6l. The go1.13.3.linux-armv6l.tar.gz should work on Raspbian.

Return to “General discussion”