Arn Vanhoutte
Arn Vanhoutte

Reputation: 1927

I can't install golang and godoc at the same time on Ubuntu

I installed golang using sudo apt-get install golang. Then I can use the go command. But there is no godoc command. I found online I can use sudo apt-get install golang-go.tools to install godoc. When I do that I can use the godoc command but the go command doesn't work anymore. How can I make them both work on the same time?

Upvotes: 0

Views: 1722

Answers (2)

Xiaorong Liao
Xiaorong Liao

Reputation: 1267

Don't install golang by apt-get.

First uninstall golang

apt-get purge golang*

Download compiled go archive from https://golang.org/dl/

wget https://storage.googleapis.com/golang/go1.7.3.linux-amd64.tar.gz
tar -xvf go1.6.linux-amd64.tar.gz
mv go /usr/local

You may need to set Go Paths. Then you can test your install.

export PATH=$PATH:/usr/local/go/bin
go version

godoc should be usable now.

Upvotes: 0

Brian Gerard
Brian Gerard

Reputation: 885

Well, my first suggestion is to try removing the golang-go.tools package, and try go get golang.org/x/tools/godoc; see if that works.

Beyond that, adding more details would help. What error(s) are you getting when you try to run the go command now?

Upvotes: 1

Related Questions