Install/upgrade #golang on #Ubuntu manually
When it comes of installing or upgrading Go on Ubuntu, I always do it manually. It might sound harder than just using some PPA, but it's not. Actually, I have not good experiences with Go PPAs on Ubuntu, they are outdated or new versions just come too late.
Follow these steps and you will be done (it also applies for other GNU/Linux distributions and FreeBSD OS)
- In case you are upgrading a version of Go, delete the existing version:
sudo rm -rf /usr/local/go
Go to the official releases index and grab your architecture release.
Extract the content of the release on the right place:
sudo tar -C /usr/local -xzf ~/LOCATION/OF/YOUR_RELEASE.tar.gz
- Make sure your
PATH
points to thebin
directory:
export PATH=$PATH:/usr/local/go/bin
- You should be done:
$ go version
<SHINY NEW VERSION MESSAGE>
In case you didn't, don't forget to set a GOPATH
variable for your workspace and add GOPATH/bin
to your PATH
.
Enjoy!
Written by Fernando Álvarez
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Linux
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#