

Ask questions and post articles about the Go programming language and related tools, events etc.
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.
Sort by:
Best
Open comment sort options
Best
Top
New
Controversial
Old
Q&A
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.
https://packages.debian.org/bullseye-backports/source/golang-1.19
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!
Other useful solutions:
https://github.com/golang/tools/tree/master/cmd/getgo
https://go.dev/doc/manage-install
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