How to install Golang (go) in WSL 2 Kali Linux, Ubuntu

Dr. Gupta
2 min readOct 25, 2021

--

What is go ?

Go is a statically typed, compiled programming language designed at Google by Robert Griesemer, Rob Pike, and Ken Thompson. Go is syntactically similar to C, but with memory safety, garbage collection, structural typing, and CSP-style concurrency. The language is often referred to as Golang because of its domain name, golang.org, but the proper name is Go.

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Go download page link: https://golang.org/dl/ copy the Linux file link address, at the time of writing this blog, it was https://golang.org/dl/go1.17.2.linux-amd64.tar.gz

Go download page https://golang.org/dl/

Now open your kali Linux terminal and download, extract go using below commands:

wget https://golang.org/dl/go1.17.2.linux-amd64.tar.gz
sudo tar -xvf go1.17.2.linux-amd64.tar.gz
sudo mv go /usr/local/
go downloaded using wget in Kali Linux

Now open your .bashrc file of your Home folder:

cd ~
sudo nano .bashrc

Now add following lines at the bottom of your .bashrc file shown as in image:

export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
.bashrc file edited to include go

Exit your terminal and open again, and check go version to confirm your installation.

go version

Thanks you.

--

--

Dr. Gupta
Dr. Gupta

Written by Dr. Gupta

ll Insomniac Doctor loves Terminal || #Security_Researcher #DayTrader || Learn and Earn || #Web3_Doctor || Rookie Smart Contract Dev & Security Researcher ||

No responses yet