Install

How to install golang

Ubuntu / Kali

#=== DOWNLOAD ===#
wget https://golang.org/dl/go1.16.3.linux-amd64.tar.gz

#=== REMOVE OLD IF EXISTS ===#
sudo rm -rf /usr/local/go

#=== INSTALL ===#
sudo tar -C /usr/local -xzf go1.16.3.linux-amd64.tar.gz

# edit .profile
sudo vim $HOME/.profile

# add this
export PATH=$PATH:/usr/local/go/bin

# load profile
source .profile

#=== CHECK VERSION ===#
go version

# go version go1.16.3 linux/amd64

#=== VIEW CONFIG ===#
go env

GOPATH="/home/thor/go" # <=== your workspace
GOROOT="/usr/local/go" # <=== root instalation of Go

#=== EXTRA: INSTALLING A TOOL ===#
# if you want to use a tool writen in go.

# add the GOPATH to $PATH in .profile
sudo vim $HOME/.profile
export PATH=$PATH:$HOME/go/bin

# install the package
go get -u github.com/tomnomnom/gf

#check if its working
gf --help

Last updated

Was this helpful?