Cannot install Go on my RasPi3

Hello all,

I am totally new in Linux and Go but I need to start somewhere, right? I am trying to install Go on my RasPi3 (armhf) with a running Debian 8 (Jessie).

This is what I have done so far:

  • downloaded file from here and selected go1.7.src.tar.gz
  • unpacked and moved it with tar -C /usr/local -xzf go1.7.src.tar.gz to /usr/local
  • added export PATH=$PATH:/usr/local/go/bin to /etc/profile

Then I checked this page to get Go installed from source.

  • fetched the repo with git clone https://go.googlesource.com/go in /home
  • moved to /home/go by cd go
  • git checkout go1.7
  • moved to /home/go/src by cd src
  • tried to run ./all.bash but this returns in an error:

Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.

What did I miss? Where do I need to add this variable and what needs to be the value for it?

I found a repo of Go for Debian 8 but this is version 1.3.3 only but I need Go1.4 at least. I was told that this is the fact why I do need to install Go from source.

Your assistance is highly appreciated.

Kind regards
//neph

take a look here.

Hello George

great, that worked perfectly fine. Thank you so much.

But I would like to understand the manual from Go. Can you tell me why
my setup did not work and how I could fix this?

Kind regards
//neph

There is no need to build from source, use the tarball for linux/arm from golang.org https://storage.googleapis.com/golang/go1.7.linux-armv6l.tar.gz

Hi Dave

sorry to ask. I know it is embarrassing, but what do I need to do with this? Where to download to (directory)? Can I use it in /usr/local? Do I need to compile something?

Could you guide me step by step from a naked Debian 8 Jessie to Debian 8 Jessie installed with Go, please? I try hardly to understand the whole procedure.

Thank you so much in advance.

Kind regards
//neph

Hello

I guess I got it. :slight_smile:

Thank you so much.

Kind regards
//neph

These are the offical release binaries, just follow the documentation on the website. Download and install - The Go Programming Language

Download the archive and extract it into /usr/local, creating a Go tree in /usr/local/go. For example:

tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz
Choose the archive file appropriate for your installation. For instance, if you are installing Go version 1.2.1 for 64-bit x86 on Linux, the archive you want is called go1.2.1.linux-amd64.tar.gz.

(Typically these commands must be run as root or through sudo.)

Add /usr/local/go/bin to the PATH environment variable. You can do this by adding this line to your /etc/profile (for a system-wide installation) or $HOME/.profile:

export PATH=$PATH:/usr/local/go/bin

just a small offtopic note… if anyone can give me an ssh access on a Raspberry pi for a while i can add armv6 in this installer so the newbies will install go more easy on those devices.

[last edit] someone went to help me and gave to me access to an Raspberry Pi with Raspbian, so i updated the Gopei project and now you can easy install golang from your Raspberry box. see here howto.