0

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?

3
  • 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
    – jobin
    Jan 11, 2014 at 6:51
  • @Jobin op tries to install go from source. Jan 11, 2014 at 7:02
  • @AvinashRaj: He is not intentionally doing that. He just wants go installed.
    – jobin
    Jan 11, 2014 at 7:48

2 Answers 2

0

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
0

To install Golang, you can just do

sudo apt-get install golang-go

which should work fine.

Not the answer you're looking for? Browse other questions tagged .