[Golang Installation Problems]Installed golang still go: command not found

Command ‘go’ not found

gkz@localhost ~$ go build
Command ‘go’ not found, but can be installed with:
sudo snap install go # version 1.12.9, or
sudo apt install golang-go # version 2:1.10~4ubuntu1
sudo apt install gccgo-go # version 2:1.10~4ubuntu1
See ‘snap info go’ for additional versions.
tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz

Two probable causes:

1. The installation is not done?

gkz@localhost ~$ ll /usr/local/go/bin/
total 34740
drwxr-xr-x 2 root root 4096 Aug 16 03:51 ./
drwxr-xr-x 10 root root 4096 Aug 16 03:48 ../
-rwxr-xr-x 1 root root 14613596 Aug 16 03:50 go*
-rwxr-xr-x 1 root root 17422189 Aug 16 03:51 godoc*
-rwxr-xr-x 1 root root 3525802 Aug 16 03:50 gofmt*
gkz@XPS13-9380 ~/workspace/go-tutorial

2. Setup Go in the PATH environment variable is unfinished.

gkz@localhost ~$ go versionCommand 'go' not found, but can be installed with:sudo snap install go         # version 1.12.9, or
sudo apt install golang-go # version 2:1.10~4ubuntu1
sudo apt install gccgo-go # version 2:1.10~4ubuntu1
See 'snap info go' for additional versions.

Add /usr/local/go/bin to the PATH environment variable. You can do this by adding this line to your /etc/profile (for a system-wide installation) or $HOME/.profile:

gkz@localhost ~$ go version
go version go1.12.9 linux/amd64
gkz@localhost ~$ which go
/usr/local/go/bin/go

--

--

🇯🇵 #SoftwareDeveloper #MeijiUniv @apc_tweet Opinions are my own. #Geek #ギークハウス大倉山 #gkz https://gkzz.github.io/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
gkzz

🇯🇵 #SoftwareDeveloper #MeijiUniv @apc_tweet Opinions are my own. #Geek #ギークハウス大倉山 #gkz https://gkzz.github.io/