Install Go on Ubuntu 20.04

Go Ubuntu

Install Go on Ubuntu 20.04 by following these steps.

Download Go:

Visit the official Go download page to get the latest version of Go for Linux. As of my knowledge cutoff in January 2022, the latest version is 1.17. Download the appropriate version for your architecture (likely linux-amd64.tar.gz).

Extract the Archive:

Open a terminal and navigate to the directory where you downloaded the Go archive. Then, extract it:

sudo tar -C /usr/local -xzf go<version>.linux-amd64.tar.gz

Make sure to replace version with the actual version you downloaded.

Set Go Environment Variables:

Add Go's binary directory to your PATH environment variable and set GOPATH. You can do this by adding the following lines to your ~/.bashrc or ~/.profile file:

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

Then, reload your shell or run source ~/.bashrc (or source ~/.profile if you modified that file).

Verify Installation: Open a new terminal window and run:

go version

This should display the installed Go version.

Comments
Loading...
Sorry! No comment found:(

There is no comment to show for this.

Leave your comment