Any PPAs for Google's Go Language?

Here's a PPA for Go. It worked for me, just now, and is maintained with golang versions for 10.04-12.04.

  • https://launchpad.net/~gophers/+archive/go

    sudo add-apt-repository ppa:gophers/go
    sudo apt-get update
    sudo apt-get install golang-stable 
    

Substitute golang-weekly or golang-tip if you want more up to date snapshots.

References:

  • https://wiki.ubuntu.com/Go
  • What are PPAs and how do I use them?

EDIT: unfortunately the Gophers archive is now discontinued (see the PPA description and http://blog.labix.org/2013/06/15/in-flight-deb-packages-of-go), now replaced by a custom binary that can be used to generate Go deb packages from source.

However, the golang package currently in Trusty is relatively recent (1.2.1 at the time of this writing). If you are still on 12.04, you might want to use this backports PPA:

  • https://launchpad.net/~bcandrea/+archive/ubuntu/backports

     sudo add-apt-repository ppa:bcandrea/backports
     sudo apt-get update
     sudo apt-get install golang
    

which I maintain trying to keep up with stable updates in official Ubuntu repositories.


2021 answer: You can use the recommended ppa:longsleep/golang-backports. It provides Golang:

  • 1.8
  • 1.9
  • 1.10
  • 1.11
  • 1.12
  • 1.13
  • 1.14
  • 1.15

You can read more info on https://launchpad.net/~longsleep/+archive/ubuntu/golang-backports.

To sum it up:

sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt update
sudo apt install golang-go

Currently, there is no PPA for the latest upstream version of Go available. To install the current Go version you can use godeb, which automatically installs the latest upstream version as a .deb package:

  1. Prepare the envorinment by creating a directory and setting the GOPATH and PATH variable:

    mkdir -p ~/.go/bin
    echo "GOPATH DEFAULT=\${HOME}/.go" >> ~/.pam_environment
    echo "PATH DEFAULT=\${PATH}:\$GOPATH/bin" >> ~/.pam_environment
    # Re-login your user so the variables are applied
    
  2. Download, unpack and install the latest Go version with godeb:

    wget -O /tmp/godeb-amd64.tar.gz https://godeb.s3.amazonaws.com/godeb-amd64.tar.gz
    tar xfz /tmp/godeb-amd64.tar.gz -C ~/.go/bin
    godeb install
    

    Go is now ready to use. For more information, see godeb --help.