Running sudo apt-get install golang-stable
, I get Go version go1.0.3
. Is there any way to install go1.1.1
?
[Updated (previous answer no longer applied)]
For fetching the latest version:
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt update
sudo apt install golang-go
Also see the wiki
If someone is looking for installing Go 1.8 the follow this:
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt-get update
sudo apt-get install golang-go
And then install go
sudo apt-get install golang-1.8-go
I like to use GVM for managing my Go versions in my Ubuntu box. Pretty simple to use, and if you're familiar with RVM, it's a nobrainer. It allows you to have multiple versions of Go installed in your system and switch between whichever version you want at any point in time.
Install GVM with:
sudo apt-get install bison mercurial
bash < <(curl -LSs 'https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer')
. "$HOME/.gvm/scripts/gvm"
and then it's as easy as doing this:
gvm install go1.1.1
gvm use go1.1.1 --default
The default flag at the end of the second command will set go1.1.1 to be your default Go version whenever you start a new terminal session.
On recent Ubuntu (20.10) sudo apt-get install golang
works fine; it will install version 1.14.
These days according to the golang github with for Ubuntu, it's possible to install the latest version of Go easily via a snap:
Using snaps also works quite well:
# This will give you the latest version of go
$ sudo snap install --classic go
Potentially preferable to fussing with outdated and/or 3rd party PPAs
You can also use the update-golang script:
update-golang is a script to easily fetch and install new Golang releases with minimum system intrusion
git clone https://github.com/udhos/update-golang
cd update-golang
sudo ./update-golang.sh