Install by command
Execute the commands one by one
1 2 3 4 5 6 7 8 9 10 11 12 | GOVERSION="go1.12.9" // thay đổi version muốn tải sudo apt update sudo apt -y upgrade echo https://storage.googleapis.com/golang/$GOVERSION.linux-amd64.tar.gz curl -O https://storage.googleapis.com/golang/$GOVERSION.linux-amd64.tar.gz sudo tar -xvf $GOVERSION.linux-amd64.tar.gz sudo rm -rf /usr/local/go sudo mv go /usr/local sudo rm $GOVERSION.linux-amd64.tar.gz |
Set $ GOPATH
1 2 3 4 5 6 | echo 'export PATH=$PATH:/usr/local/go/bin' >>~/.profile echo 'export GOPATH=$HOME/go' >>~/.profile echo 'export PATH=$PATH:$GOPATH/bin' >>~/.profile source ~/.profile |
Restart computer
Install using automatic script file
1 2 | git clone https://github.com/long25vn/Configure |
1 2 | cd Configure/Golang |
1 2 | sudo ./Install-Go.sh |
See more at https://github.com/long25vn/Configure