The default way of installing Go development tools via apt is to use the below command
sudo apt install golang
This installation, in most cases, will contain a slightly older version of the Go development tools. If we want to update to the latest version of Go, then we can use the Golang Backports PPA which hosts the latest versions of Go.
Below is how we can use the Golang Backports PPA
- Add the repository
sudo add-apt-repository ppa:longsleep/golang-backports
- Update apt
sudo apt update
- Install Go
sudo apt install golang-go
- Alternatively, we can provide specific versions as well
sudo apt install golang-1.19
The above-mentioned method works for both standalone and WSL installations of Ubuntu (tested with Ubuntu 22.04 on WSL2).
Top comments (0)