I have already installed go1.9.2 on my Linux system using these commands:
(for some reason I have to use this old version)
sudo tar -C /usr/local -xzf go1.9.2.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.profile
source ~/.profile
go version
go version go1.9.2 linux/amd64
But when I run it as root it gave me the following error:
root@mininet-vm:/home/mininet# go version
Command 'go' not found, but can be installed with:
apt install golang-go # version 2:1.13~1ubuntu2, or
apt install gccgo-go # version 2:1.13~1ubuntu2
I’m think this happens because you install this on your user, so, you can repeat the same echo command with the root user or configure how the documentation explain: Download and install - The Go Programming Language
You can do this by adding the following line to your $HOME/.profile or /etc/profile (for a system-wide installation):