Skip to content
Metalop.comJust Another Blog about Technology
  • Technology
  • Programming
  • Other Stuff

How to Install Latest Version of Go on the Raspberry Pi 5

December 7, 2023 1 comment Article Raspberry Pi, Technology Shiva
Table of Contents
  • Introduction
  • Download the latest version from go website
    • Checking for the right version
  • Extract the downloaded file
  • Configure Environment variables
  • Test your version

Introduction

So finally I got my hands on the latest version of Raspberry Pi 5 and after the initial setup decided to build an Air Quality Monitor using it. For some reason decided to write the interface using Go.

Installing the latest version of go should be as simple as apt install but unfortunately the latest version is not available in the apt repo. You can check this by running

apt policy golang

The current version of Go is 1.21 as of writing this, but the one available on apt is 1.19.

Download the latest version from go website

Please copy the link for the latest version of Go , from Go download page.

Checking for the right version

Please select the arm64 version if you are running the 64 bit OS or download armv6l version if you are running 32 bit OS. A quick way to check it is by running

uname -m

If the output says aarch64 GNU/Linux in the output string its 64 bit else if its armv7l GNU/Linux its a 32 bit OS.

I have a 64 bit OS so will be using it. To download execute

wget https://go.dev/dl/go1.21.4.linux-arm64.tar.gz

Extract the downloaded file

Once the download finishes, extract it to /usr/local

sudo tar -C /usr/local -xzf go1.21.4.linux-arm64.tar.gz 
rm go1.21.4.linux-arm64.tar.gz 

Configure Environment variables

Now as the last step we’ll add the go binary to the PATH variable and add the value for GOPATH variable. To do this open your ~/.profile in a text editor(nano, vi, vim etc). I have vim installed to, used the following command

vim ~/.profile

Append the following line in the file and save it

PATH=$PATH:/usr/local/go/bin
GOPATH=$HOME/go

Now you can refresh your shell using the following command or open a new terminal

source ~/.profile

Test your version

To test if everything got configured correctly simply execute go version if all worked fine you should get an output string something like go version go1.21.1 linux/arm64. cheers!

Tags: Raspberry Pi, Raspberry Pi 5

1 comment

  • Alperen January 27, 2024 at 10:28 pm Reply

    Thank you!

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Blogroll

  • Documentation
  • Plugins
  • Suggest Ideas
  • Support Forum
  • Themes

Archives

  • August 2024
  • December 2023
  • July 2019
  • June 2019
  • August 2016
  • April 2016
  • December 2015
  • August 2015
  • July 2015
  • June 2015
  • June 2014
  • October 2013
  • August 2013
  • March 2013
  • February 2013

Categories

  • Other Stuff
  • Programming
  • Raspberry Pi
  • Technology
  • Uncategorized

Most Tagged

Adaptive Streaming Android android apps apache knox Applock aviate big data classloading Contacts+ hadoop HTML5 J2SE Java JavaScript JBoss Keycloak Keycloak-1.2.0-Final knox MPEG-DASH Pushbullet Raspberry Pi Raspberry Pi 5 RP5 security SSO Video Youtube

Categories

  • Other Stuff
  • Programming
  • Raspberry Pi
  • Technology
  • Uncategorized

No Rights Reserved. | Theme by ThemeinProgress | Proudly powered by WordPress