Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error while installing go from source

Tags:

go

i am trying to install go from source

i follow this steps

git clone https://go.googlesource.com/go
cd go
git checkout go1.6.1

cd src
./all.bash

now it gives me the error saying

##### Building Go bootstrap tool.
cmd/dist
ERROR: Cannot find /root/go1.4/bin/go.
Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.

any idea how can i fix this do i just need to set env variable or any other installation is needed ?

like image 502
Abhi Adr Avatar asked Apr 18 '16 08:04

Abhi Adr


2 Answers

You need to have an installed Go version 1.4 or newer to build the recent Go releases. The build script defaults to some path but if it's not there you need to set GOROOT_BOOTSTRAP environment variable to point to a previous working Go installation.

like image 194
Art Avatar answered Oct 24 '22 05:10

Art


Go is written in Go (starting from version 1.5) so you have to install Go1.4 first. Just get Go Version Manager and run:

$ gvm install go1.4 
$ gvm use go1.4 
$ export GOROOT_BOOTSTRAP=$GOROOT

Another approach is about to install gcc go frontend:

$ sudo apt-get install gccgo-5
$ sudo update-alternatives --set go /usr/bin/go-5
$ export GOROOT_BOOTSTRAP=/usr
like image 3
Alex Avatar answered Oct 24 '22 05:10

Alex