Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This should be a simple thing.

I followed the instruction on "http://golang.org/doc/install" to install "Go" on Ubuntu.

  1. Downloaded it
  2. Unzipped it to "usr/local"
  3. Added the path in "/etc/profile" (export PATH=$PATH:/usr/local/go/bin)

But when I type in "go" it says "The program 'go' is currently not installed".

What should I do?

share|improve this question
    
Add the path to your .profile in your home... –  Ask Jan 11 at 6:17
    
doesn't "/etc/profie" apply a system-wide variable so I don't have to add in ".profile"? What if another user wants to run "go"? –  ericbae Jan 11 at 6:19
    
after adding the path source the etc/profile file. –  Avinash Raj Jan 11 at 6:20
    
Were any of the answers helpful? –  i08in Feb 13 at 20:10

3 Answers 3

The easiest way to install go 1.0.3 on ubuntu is to do

sudo apt-get install golang-stable

To install version 1.1.1 do this:

sudo apt-get install python-software-properties  # 12.04
sudo add-apt-repository ppa:duh/golang
sudo apt-get update
sudo apt-get install golang

Source: How to install current version of go on ubuntu

share|improve this answer
gedit /etc/profile

Add the below line,

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

Then source the /etc/profile,

source /etc/profile

Logout and login back.

share|improve this answer
    
This is strange, I did "source /etc/profile" and it worked. Then I logged out and logged back in and it now says the same error "go is not installed". When I "source" again, it works. –  ericbae Jan 11 at 6:27
    
Also, when I do "source" it works under my user name, but if I change to "root", I get "go is not installed" error again. ??? –  ericbae Jan 11 at 6:31
    
after sourcing the profile file,restart your pc. –  Avinash Raj Jan 11 at 6:32
    
That's not working either. –  ericbae Jan 11 at 6:37
    
to make it system-wide add the path to /etc/environment see help.ubuntu.com/community/… –  Avinash Raj Jan 11 at 6:46

You can use this, for system-wide installation:

echo 'PATH DEFAULT=${PATH}:/usr/local/go/bin' | sudo tee -a /etc/environment

Logout then back in.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.