Install Go on Ubuntu: A Quick Setup Guide

The steps to install Golang are as follows:

  1. Open the terminal and use the following command to download the golang installation package:
wget https://dl.google.com/go/go1.16.3.linux-amd64.tar.gz

Please ensure to download the latest version as the version number in the download link may be updated.

  1. Unzip installation package.
sudo tar -C /usr/local -xzf go1.16.3.linux-amd64.tar.gz
  1. The profile file
export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
  1. Activate the environment variables.
source ~/.profile
  1. To verify the successful installation, enter the following command to check the version of golang.
go version

If installed successfully, the version information of golang will be displayed.

After installation is complete, you can start developing with golang on Ubuntu.

bannerAds