How to install golang (go) >1.21 in Ubuntu with Snap

Install golang in a somewhat recent version in Ubuntu is quite annoying. Here a on-line command which will do the trick for you. (Replace 1.21 with whatever version of go you want to install)

sudo apt remove --autoremove golang-go; sudo apt install snapd; sudo snap install --classic --channel=1.21/stable go

What it does:

  1. sudo apt remove --autoremove golang-go Remove all current go installation you installed via apt
  2. sudo apt install snapd; Install snap (Software packaging system by Canonical <= Folks behind ubuntu. Learn more)
  3. sudo snap install --classic --channel=1.21/stable go Use snap to install golang

This works like a charm, and after hours of trying to make it work via the binary download “official” way mentioned on the golang.org this finally made my golang installation work.

Software exists to create business value

I am Simon Frey, the author of this blog. And I have great news: You can work with me

As CTO as a Service, I will help you choose the right technology for your company, build up your team and be a deeply technical sparring partner for your product development strategy.

Checkout my website simon-frey.com to learn more or directly contact me via the button below.

Simon Frey Header image
Let’s work together!
To never miss an article subscribe to my newsletter
No ads. One click unsubscribe.