- Start by open your web browser and visit https://golang.org/dl/
- Download the latest version for Linux – “gox.xx.x.linux-amd64.tar.gz”
- Open your terminal and navigate to your downloads folder cd /root/Downloads
- Extract the files tar -C /usr/local/ -xzf go1.13.6.linux-amd64.tar.gz
- Add variables for GO by modifying “~/.bashrc” nano ~/.bashrc
Add the following paths to the end of the file__ export GOPATH=/root/go-workspace export GOROOT=/usr/local/go PATH=$PATH:$GOROOT/bin/:$GOPATH/bin
-
Now we need to refresh the bashrc to get the updated variables source ~/.bashrc
-
go version
- sudo go install -v github.com/tomnomnom/anew@latest && sudo cp /root/go/bin/anew /usr/bin/
- You can check the installation by running: anew -h command.