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 question already has an answer here:

I have Ubuntu on Linode VPS.

I intstalled latest Golang as instructed on this page (http://golang.org/doc/install) - steps taken are

  1. wget http://go.googlecode.com/files/go1.2.linux-amd64.tar.gz
  2. tar -C /usr/local -xzf go1.2.linux-amd64.tar.gz
  3. Added a line "export PATH=$PATH:/usr/local/go/bin" in "/etc/profile"

After this, however, when I type in "go", I get "program 'go' is not installed".

So I did

"source /etc/profile"

And after that it worked. However, when I logged out and logged back in, it didn't work and I got the same error. So I did "source /etc/profile" and it worked again.

But, even after "source /etc/profile", if I change my user name to something else (e.g. "root"), I get the same error.

I've been reading and it looks like something to do with loading ".profile" or ".bashrc". But I'm not sure what the difference is between the two. What I want to achieve is to install "go" so that any user can run it.

Any ideas?

share|improve this question

marked as duplicate by minerz029, karel, Radu Rădeanu, guntbert, Braiam Jan 11 at 11:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Would it be better to answer the question "How to install go for all users on the system?". If yes, please look at the answer here: askubuntu.com/a/403780/72576 –  i08in Jan 11 at 6:51
    
@Jobin op tries to install go from source. –  Avinash Raj Jan 11 at 7:02
    
@AvinashRaj: He is not intentionally doing that. He just wants go installed. –  i08in Jan 11 at 7:48

2 Answers 2

To install Golang, you can just do

sudo apt-get install golang-go

which should work fine.

share|improve this answer

You could try to add the line to your personal profile, in:

$HOME/.profile

Just type this in a terminal:

echo "PATH=$PATH:/usr/local/go/bin" in "/etc/profile" >> $HOME/.profile

Then, log out and log in again, or reload the configuration with:

source $HOME/.profile
share|improve this answer

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