Reputation: 3
After a purchase of ARK-20-S8A11E, i find out that it only supports ubuntu 12.04 and that network manager uses snap which only availale on ubuntu 14 onward. I need Mobilemanager to collect information of an LTE module integrated in the PC. For that, i tried to install snap from source. I needed "go", and with apt-get install golang, the last version installed on precise is go1. and snap uses go1.6 onward version.
Therefore, i installed the latest version of go from sources. It is well installed, the output of go --version is : go version go1.11.4 linux/amd, and tested a basid hello.go. I followed this link for snap installation: https://github.com/snapcore/snapd/blob/master/HACKING.mdsnap.
The build command " sudo -E go build -o /tmp/snap github.com/snapcore/snapd/cmd/snap" give an output as the "go command not found". The GOPATH and PATH are well verified, the go env also.
Could you please help me sort this issue?
Thank you,
Upvotes: 0
Views: 1194
Reputation: 16029
sudo
is the troublemaker here. When sudoing the $PATH
env var is replaced with the secure_path
from /etc/sudoers
(see this and this.)
Either do not run go as sudo, add the go path to the secure_path
or include the full path to go in your command (sudo -E /usr/local/bin/go build -o /tmp/snap github.com/snapcore/snapd/cmd/snap
)
Upvotes: 1