• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
Installing Google's Go Language on Ubuntu 
 
GO languagepromoted by google is a new system programming language said to be expressive,concurrent, garbage-collected. The language is still very young and there is no ready madepackage available for ubuntu. You can install it and try out the features from the version controlrepository of go .Let us see how you can do this. I did it on ubuntu 9.04.
1) Install Pre-requisites on ubuntu.
 You need gcc and some supporting software like bison to compile go. Install the following.
$ sudo apt-get install bison gcc libc6-dev ed.
 
The go repository uses mercurial version controls system .Install mercurial with the following command.
$ apt-get install mercurial
 
2 Set up the environment variables.
 I am assuming that you are planning to install go under a foldernamed go in your home directory.In my case it is /home/fermi/goCreate it with
$mkdir go
 
Now create another direcory inside go .
$ mkdir go/bin
 
The above directory will contain your go compiler.Next, you have to set u several variables.
 
$ export GOROOT=/home/fermi/go/hg$ export GOOS=linux$ export GOARCH=386$ export GOBIN=/home/fermi/go/bin
 
( Note: You need not create the folder hg. You can also add the abovefour lines along with the PATH variable below to the .bashrc fileif you are planning to use go regularly.)Update your PATH variable .
$ export PATH=$PATH:$GOBIN
Check the environment variables with.
$ env | grep '^GO'
 
I got like this.GOBIN=/home/fermi/go/bin/GOARCH=386GOROOT=/home/fermi/go/hgGOOS=linux
3) Grab the source code from mercurial
$hg clone -r releasehttps://go.googlecode.com/hg/$GOROOT
It created /home/fermi/go/hg and downloaded several files to it.To build the Go distribution run.
4) Compile Go
 
$ cd $GOROOT/src$ ./all.bash
 
Now wait for some time. The compilations will proceed and will becompleted with the following message
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...