Skip to content

Instantly share code, notes, and snippets.

@Adron
Last active October 6, 2025 12:40
Show Gist options
  • Select an option

  • Save Adron/4e1e7d0f71da7c415f455d5930ea94c9 to your computer and use it in GitHub Desktop.

Select an option

Save Adron/4e1e7d0f71da7c415f455d5930ea94c9 to your computer and use it in GitHub Desktop.
Installing golang via apt-get
sudo add-apt-repository ppa:ubuntu-lxc/lxd-stable
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install golang
# Usually this is good to install golang, but alas the apt-get repo is usually out of sync with the latest.
@kenk667

kenk667 commented Feb 9, 2018

Copy link
Copy Markdown

latest is sudo add-apt-repository ppa:ubuntu-lxc/stable

@imfht

imfht commented May 21, 2018

Copy link
Copy Markdown

@d78ui98

d78ui98 commented Sep 13, 2018

Copy link
Copy Markdown

Are these method necessary now?
why can't I cant just update and do

sudo apt install golang-go

With this I get the lastest version 1.6.2

@Syakyr

Syakyr commented Oct 8, 2018

Copy link
Copy Markdown

Latest version is 1.10, not 1.6.2.

@ocidenttal

Copy link
Copy Markdown

Latest version is 1.16 now boys, read the official wiki, there's a installation guide

@nigurr

nigurr commented Aug 24, 2021

Copy link
Copy Markdown

This is better option in my view: https://github.com/stefanmaric/g

@noraj

noraj commented Oct 3, 2021

Copy link
Copy Markdown

This is better option in my view: https://github.com/stefanmaric/g

In my opinion this is better, https://asdf-vm.com with https://github.com/kennyp/asdf-golang

@Adron

Adron commented Nov 2, 2021

Copy link
Copy Markdown
Author

I concur @noraj and @nigurr, and all others, there are newer version and better ways to get Go installed based on what you're doing.

This gist is here for reference to a past blog entry and links. YMMV on use or if this even works anymore.

@kecsi-san

Copy link
Copy Markdown

Yes. Agree. Keep it. Good source of info! Thanks.

@teraswag

teraswag commented Sep 21, 2023

Copy link
Copy Markdown

Cant you just use this:
sudo apt install nala
sudo nala install golang

@Adron

Adron commented Dec 8, 2023

Copy link
Copy Markdown
Author

This OP I wrote is pretty dated at this point @g1gabyteDEV. So YMMV and I don't even do it this way anymore. 👍

ghost commented Feb 7, 2025

Copy link
Copy Markdown

Are these method necessary now? why can't I cant just update and do

sudo apt install golang-go

With this I get the lastest version 1.6.2

This still works in 2025 by the way.

@AjmalShajahan

Copy link
Copy Markdown

Updated wiki https://go.dev/wiki/Ubuntu#using-ppa
Installs latest version by default, current default go1.23.6, go1.24.0 was released on 2025-02-11.

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

@RobotWiz

Copy link
Copy Markdown

Updated wiki https://go.dev/wiki/Ubuntu#using-ppa Installs latest version by default, current default go1.23.6, go1.24.0 was released on 2025-02-11.

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

I would rather avoid adding the ppas to my debian again, these shouldn't be needed

@AjmalShajahan

AjmalShajahan commented Oct 6, 2025

Copy link
Copy Markdown

Updated wiki go.dev/wiki/Ubuntu#using-ppa Installs latest version by default, current default go1.23.6, go1.24.0 was released on 2025-02-11.

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

I would rather avoid adding the ppas to my debian again, these shouldn't be needed

yeah, IIRC it was to get the latest go build on ubuntu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment