How to install Go [golang] on Ubuntu Linux

To install Go (Golang) on Ubuntu Linux, you can follow these steps:

  1. Download the latest version of Go from the official website by running the following command:
wget https://golang.org/dl/go1.x.linux-amd64.tar.gz
  1. Extract the downloaded archive by running the following command:
tar -xvf go1.x.linux-amd64.tar.gz
  1. Move the extracted folder to the ‘/usr/local’ directory by running the following command:
sudo mv go /usr/local
  1. Add the Go bin directory to your system’s PATH environment variable by adding the following line to your ‘~/.bashrc’ file:
export PATH=$PATH:/usr/local/go/bin
  1. Reload your ‘~/.bashrc’ file to apply the changes by running the following command:
source ~/.bashrc
  1. Verify that Go is installed correctly by running the following command:
go version

You should see the version of Go that you just installed. Now you can start developing in Go by creating a new directory for your project, setting the GOPATH environment variable, and creating Go files.

Note: The above commands are for Go version 1.x, make sure you download the correct version you want to install.

Leave a Comment