Install golang from command line

Drake Evans
Oct 17, 2021

--

Get the path to the tar file

https://golang.org/doc/install

https://golang.org/dl/go1.17.2.linux-amd64.tar.gz

Get the file with wget

curl -O -L "https://golang.org/dl/go1.17.2.linux-amd64.tar.gz"

Unpack with tar

tar -xf "https://golang.org/dl/go1.17.2.linux-amd64.tar.gz"

Move go to usr/local

sudo mv -v go /usr/local

Add these lines to ~/.bash_profile

# set up Go lang path #
export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin

--

--

Drake Evans
Drake Evans

Written by Drake Evans

A smart man can rationalize anything; set rules and don't break them. Biomedical Engineering, Computer Science, Finance, Economics.

No responses yet