---
title: "Go on Ubuntu"
description: "Go is a compiled, garbage-collected, concurrent programming language developed by Google Inc. Below is a simple script to."
url: "https://h3manth.com/scribe/go-ubuntu/"
canonical_url: "https://h3manth.com/scribe/go-ubuntu/"
markdown_url: "https://h3manth.com/scribe/blog/go-ubuntu.md"
publishDate: "2010-04-06T00:00:00.000Z"
author: "Hemanth HM"
category: "python"
tags: ["python","ubuntu","bash","linux"]
word_count: 172
reading_time_minutes: 1
x_markdown_tokens: 363
content_signal: "ai-train=yes, search=yes, ai-input=yes"
---

# Go on Ubuntu

> Go is a compiled, garbage-collected, concurrent programming language developed by Google Inc. Below is a simple script to.

**Go is a compiled, garbage-collected, concurrent programming language developed by Google Inc.**

Below is a simple script to intsall it:

``

## !/bin/bash

## Save the pwd

cwd=`pwd`

## Set the env

cat >> ~/.profile << EOT export GOROOT=$HOME/go export GOOS=linux export GOARCH=`arch` export GOBIN=$HOME/bin EOT

## Set the Path

cat >> ~/.bashrc << EOT export PATH=${PATH}:$GOBIN EOT

## Source them

source ~/.profile source ~/.bashrc

## Build deps

sudo apt-get install python-setuptools python-dev build-essential mercurial bison gcc libc6-dev ed make

## Check out the source

hg clone -r release https://go.googlecode.com/hg/ $GOROOT

## Build the source

cd $GOROOT/src ; ./all.bash

## Get back

cd $cwd _Note: File attached with this post_ **Testing** $ cat >hello.go <<EOF package main import "fmt" func main() {
    
    
    fmt.Printf("Hello, GO!\n")
    

} EOF $ 6g hello.go $ 6l hello.6 $ ./6.out ` With ggcgo $ gccgo hello.go $ a.out ` _Note:_ 6g => amd64; 386 => 8 and arm => 5\. _Updating_ ` $ cd $GOROOT/src $ hg pull $ hg update release $ ./all.bash ` **Keep GOing :)**
