Do you know of any URLs for PPAs of Google's Go Language?
8 Answers
2023 answer: If you're using Ubuntu between 16.04 and 22.04 on amd64, arm64, armhf or i386, you can use the recommended ppa:longsleep/golang-backports
.
It provides Golang from version 1.8 to 1.21
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
Note that golang-go installs latest Go as default Go. If you do not want that, install
golang-1.19
instead and use the binaries from/usr/lib/go-1.19/bin
for example.
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:
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.
-
I've installed this PPA and I seem to have all the relevant packages installed (stable version). But where are the executables? I'm trying the usual ones - 6g and 6l are not in the path.– egarciaMar 19, 2012 at 19:02
-
4
-
2...aaaaand it's yet another dead PPA without packages for current versions of Ubuntu. Oct 6, 2015 at 18:24
-
1Please unmark this answer as the right one, it's no longer relevant. Jan 9, 2019 at 20:14
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:
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
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
.
-
2
-
Yes, just discovered this myself as the correct answer. You can read a blog post about it here. blog.labix.org/2013/06/15/in-flight-deb-packages-of-go Oct 7, 2016 at 15:25
-
On Ubuntu Xenial, the "prepare environment" instructions don't work for me. The .pam_environment is executed, but
${HOME}
apparently is empty, so GOPATH ends up as/.go
, which is a no-go. Jan 9, 2019 at 20:23 -
See my answer below for info on how to install go
v1.11
from the gophers archive PPA. Apr 1, 2019 at 1:41
I've not been able to find a PPA, but the gccgo
developer has posted .deb packages on his sourceforge site.
Individuals have been working on packaging upstream Go in Debian, see the WNPP bug for more info. You might be able to build a deb from the hg
repo as folloows:
hg clone http://hg.debian.org/hg/collab-maint/golang/
cd golang
debuild -us -uc
I'm not terribly familiar with using hg
to build debian packages, and keep in mind this is development packaging you're working with.
-
1
I used this one ppa:ubuntu-lxc/lxd-stable
that has the near to latest version
-
Why has this been downvoted? They actually provide a package of golang with version 1.6 beta. It worked well for me! Jan 21, 2016 at 7:25
-
Corresponding Launchpad page: launchpad.net/~ubuntu-lxc/+archive/ubuntu/lxd-stable– VegerSep 8, 2016 at 8:34
-
This is what I have been using but they are currently lagging behind. Right now their version is 1.6.2, but 1.6.3 and 1.7 have been released. Oct 7, 2016 at 15:17
gccgo has official .deb packages in Debian experimental now.
This should be all you need to compile go code into an executable.
More info and links here:
As latest Ubuntu is usually a pull from experimental, then it should certainly be in 11.04 Natty Narwhal.
If you want roll you own .deb for a previous Ubuntu version, then comment from @lfaraone will get you access to debianized selection of google's own source.
If you want to pull the source direct from Google then there is a recent article by @mirwing telling you how to do that.
Go versions 1.4 through 1.11 for Ubuntu Trusty, Xenial, Bionic, Cosmic and Disco can be installed from here: https://launchpad.net/~gophers/+archive/ubuntu/archive
sudo add-apt-repository ppa:gophers/go
sudo apt-get update
sudo apt-get install golang-1.11-go
Note: After install, you will need to add /usr/lib/go-1.X/bin
(or maybe /usr/lib/go-tip/bin
) to your $PATH
, or you can just invoke /usr/lib/go-1.X/bin/go
directly.
I got gpg failure gpg: keyserver receive failed: No name
Interestingly it on snap, so snap user can easily type
sudo snap install go --classic
but remember if you already have go you should apt remove go-lang before install go
in case someone faces 404