douchen4534
2015-09-17 14:38
浏览 43

在Ubuntu上安装

I am trying to setup a go dev environment on Ubuntu, and having no luck. Following directions here https://github.com/golang/go/wiki/Ubuntu

sudo apt-get install golang

Then I

mkdir $HOME/golang
export GOPATH=$HOME/golang

No dice. Even doing something simple like go version throws the following error:

go: cannot find GOROOT directory: /usr/local/opt/go/libexec

Everywhere I look online says simply not to set GOROOT. Please help, I don't understand where to go from here. This is a fresh install on a fresh VM.


GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/isaac/golang"
GORACE=""
GOROOT="/usr/local/opt/go/libexec"
GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/linux_amd64"
TERM="dumb"
CC="gcc"
GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread"
CXX="g++"
CGO_ENABLED="1"

图片转代码服务由CSDN问答提供 功能建议

我试图在Ubuntu上设置go dev环境,但没有运气。 请按照此处 https://github.com/golang/go/wiki/Ubuntu < / p>

  sudo apt-get install golang 
 </ code> </ pre> 
 
 

然后我</ p>

 < 代码> mkdir $ HOME / golang 
export GOPATH = $ HOME / golang 
 </ code> </ pre> 
 
 

没有骰子。 即使执行诸如 go version </ code>之类的简单操作也会引发以下错误:</ p>

  go:找不到GOROOT目录:/ usr / local / opt / go / libexec  
 </ code> </ pre> 
 
 

我在网上看到的每个地方都说根本不设置 GOROOT </ code>。 请帮助,我不知道从这里去哪里。 这是在新VM上的全新安装。</ p>


  GOARCH =“ amd64” 
GOBIN =“” 
GOCHAR =“ 6” 
GOEXE =  “” 
GOHOSTARCH = “AMD64” 
GOHOSTOS = “LINUX” 
GOOS = “LINUX” 
GOPATH = “/家/艾萨克/ golang” 
GORACE = “” 
GOROOT =“在/ usr /本地的/ opt /去/ libexec目录 “ 
GOTOOLDIR =” / usr / local / opt / go / libexec / pkg / tool / linux_amd64“ 
TERM =” dumb“ 
CC =” gcc“ 
GOGCCFLAGS =”-g -O2 -fPIC -m64 -pthread“ \  nCXX =“ g ++” 
CGO_ENABLED =“ 1” 
 </ code> </ pre> 
 </ div>

3条回答 默认 最新

相关推荐 更多相似问题