Skip to main content Go Linux/Debian users which is the apt command to install Go via terminal? : r/golang
r/golang icon
Go to golang
•

Go Linux/Debian users which is the apt command to install Go via terminal?

newbie

Reason I want to do it this way is to get autoupdates via sudo apt upgrade.

I do apt search go the report is too long to know which.

Thanks much.

You only have time for real-time. Start fast and deliver production-ready app experiences at any scale—on Google Cloud, AWS, and Azure—with Redis-as-a-Service. Start for free today.
Thumbnail image: You only have time for real-time. Start fast and deliver production-ready app experiences at any scale—on Google Cloud, AWS, and Azure—with Redis-as-a-Service. Start for free today.
Sort by:
Best
Open comment sort options

I’m not sure if there’s an official apt repo for Go. I don’t think there is but am happy to be corrected. There’s a bunch of unofficial PPAs but the official (and safe!) way is to get the binary from go.dev.

If you wish you can download the tar.gz and package it up into a deb and put it on a PPA you control. Then you’ll be able to deploy it across your computers.

Or simply write a script to download it once and distribute/upgrade it.

More replies
[deleted]
•

Use apt-file to find which package a file belongs to.

I use this tool and it is working pretty fine

https://github.com/udhos/update-golang

Excellent, thank you.

this one is brilliant, works like a charm!

More replies

There is a snap for go. I normally download the appropriate tar.gz and follow the Install instructions, but I've got a couple of machines (actually WSL on Windows) where I've used the snap.

apt install golang. But the version in the stable (bullseye) repo is 1.15 iirc so you’ll want to use backports which has 1.18