command 'go' not found
Solution 1:
Jos in the comments above is likely correct. You need to add the change to PATH
in your .profile
. From the install doc (emphasis added):
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
:export PATH=$PATH:/usr/local/go/bin
Solution 2:
From: Installed golang still go: command not found #20
Use this command:
sudo apt update && sudo apt install golang
Solution 3:
Use nano ~/.profile
to edit the file and add the following:
export PATH=$PATH:/usr/local/go/bin
Save the file using the command source ~/.profile
.
Check the version:go version
Solution 4:
Make sure that the GOPATH
environment variable is set to /usr/local/bin
.
Solution 5:
Try adding the exact export command to the ~/.bashrc
file.
You need to source the ~/.bashrc
file for changes to take place in your current terminal. From next time onward whenever you open a terminal, you should be able to find the go
command. This worked for me.