Installing the Latest Go Version on Ubuntu

Dec 01, 2025 · Programming · 11 views · 7.8

Keywords: ubuntu | go | installation | version_management

Abstract: This article discusses multiple methods to install the latest Go version on Ubuntu systems, focusing on PPA installation as the primary approach, supplemented by GVM for version management, with analysis of pros and cons for developers and system administrators.

Introduction

In Ubuntu, installing Go via the package manager may provide outdated versions like go1.0.3, while the latest stable release is go1.1.1 or newer. This article explores how to install the current Go version on Ubuntu, emphasizing the most effective methods.

Installing the Latest Go Version Using PPA

Based on the best answer, the recommended method involves adding a Personal Package Archive (PPA) for the latest version. Execute the following commands in the terminal:

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

This PPA is maintained by the Go community and regularly updated, ensuring access to the latest version. Refer to the official wiki for detailed information.

Managing Multiple Go Versions with GVM

As an alternative, you can use the Go Version Manager (GVM) to install and switch between different versions, ideal for developers needing multiple releases. First, install GVM:

sudo apt-get install bison mercurial
bash < <(curl -LSs 'https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer')
. "$HOME/.gvm/scripts/gvm"

Then, install and use a specific version:

gvm install go1.1.1
gvm use go1.1.1 --default

The --default flag sets it as the default version for new terminal sessions.

Other Installation Methods

Other PPAs such as ubuntu-lxc/lxd-stable are outdated; currently, for Ubuntu 18.04 and later, the longsleep/golang-backports PPA is recommended. Always check the official repository for updates.

Comparison and Recommendations

The PPA method is straightforward and suitable for most users needing the latest stable version. GVM is more flexible, allowing multiple version management, ideal for testing or development environments. The choice depends on individual requirements.

Conclusion

To install the current Go version on Ubuntu, adding the longsleep/golang-backports PPA is the best practice. For version management, GVM offers a powerful alternative. After installation, run go version to verify the version.

Copyright Notice: All rights in this article are reserved by the operators of DevGex. Reasonable sharing and citation are welcome; any reproduction, excerpting, or re-publication without prior permission is prohibited.