- Download it from https://golang.org/dl/
$ curl -sSL https://golang.org/dl/goX.XX.X.linux-amd64.tar.gz -o goX.XX.X.linux-amd64.tar.gz
replace the X.XX.X with current version.
- Extract the downloaded file to
/usr/local
$ sudo tar -C /usr/local -xzf goX.XX.X.linux-amd64.tar.gz
- Add the path
/usr/local/go/bin
to the environment variable, and for that just add the below lines to your .bashrc file, which is located on your home directory~/.bashrc
. Add below lines
export GOROOT=/usr/local/go export GOPATH=$HOME/go export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
and now you are good to GO {he he !!}. Test the setup with go version
$ go version go version go1.15.3 linux/amd64
thats it.