The title is the problem - here is a brief explanation as to how I got here as I imagine that may help with sleuthing.
I installed go, and everything was fine. I ran build essential golang
command on Ubuntu, and all of a sudden my go version was out of sync with my /usr/local/go/src/VERSION
file.
I deleted my go files at /usr/local/go/
, as well as the go and the go-1.8 folders in /usr/bin/
. I then reinstalled go at /usr/local/go
Now, when I run go env
as a user, the output looks correct. However (the title), when I am sudo
, no go commands are recognized and I get the following message: The program 'go' can be found in the following packages:
* golang-go
* gccgo-go
As a user, some of my go env output is:
GOPATH="/home/{me}/go"
GOROOT="/usr/local/go"
As a user, my echo $PATH
is :
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/go/bin:/home/{me}/go/bin
My ~/.profile
includes:
export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
Help, please? : )