This post explains how to install Go on Raspberry Pi.
(2 Model B) shows it has ARMv7 processor.
$ uname -m armv7l
# Download archive $ wget https://storage.googleapis.com/golang/go1.8.linux-armv6l.tar.gz # Extract it into /usr/local. It will create a Go tree in /usr/local/go $ sudo tar -C /usr/local -xzf go1.8.linux-armv6l.tar.gz # Add /usr/local/go/bin to the PATH environment variable. # You can do this by adding a line to your /etc/profile # (for a system-wide installation) or $HOME/.profile as shown below $ echo 'export PATH=$PATH:/usr/local/go/bin' >> $HOME/.profile # Above PATH setting will work when we re-login. Export it in current session as well. $ export PATH=$PATH:/usr/local/go/bin
If all above steps worked fine, you will be able to execute
go commands. Let’s check version.
$ go version go version go1.8 linux/arm
Sweet! Follow this guide to test the new installation by building ‘Hello World!’ program.
You will soon be installing external libraries/packages using
The go get fetching of source code is done by using one of the tools mentioned here
and it is expected to be found on your system. I installed git from that list using below command
# Using apt-get, since I have `Raspbian` installed on my RPi $ sudo apt-get install git
Author Pradip Patil
LastMod Feb 26, 2017