How to Install Go on Ubuntu

Hey! If you love Go and building Go apps as much as I do, let's connect on Twitter or LinkedIn. I talk about this stuff all the time!

Want to learn how to build better Go applications faster and easier? You can.

Check out my course on the Go Standard Library. You can check it out now for free.


This article will guide you through the process of installing Go on your Ubuntu 18.04 or later system. Once installed, you’ll be able to write and run Go code on your machine.




Installing Go on Ubuntu is a straightforward process that involves adding the official Go repository to your system and then installing the package using the apt package manager. Here are the steps you need to follow:

  1. Add the Go repository to your system by running the following command in your terminal:
sudo add-apt-repository ppa:longsleep/golang-backports

This will add the official Go repository to your system, which contains the latest stable releases of Go.
2. Update your package list by running the following command:

sudo apt update
  1. Install the go package using the following command:
sudo apt install go

This will download and install the latest version of Go on your system.
4. Once installed, you can test that Go is working by running the following command in your terminal:

go version

This should display the version number of Go that you just installed.
5. You can also verify that the go executable is in your PATH by running the following command:

which go

If everything has been set up correctly, this should display the path to the go executable on your system.

That’s it! You now have Go installed on your Ubuntu system and can start writing and running Go code.

Conclusion:

Installing Go on Ubuntu is a straightforward process that involves adding the official Go repository to your system and then installing the package using the apt package manager. With these steps, you’ll be able to write and run Go code on your machine.


Questions or comments? Reach out to me


Learn how to leverage the Go Standard Library like a PRO.

I just created a new course, The Go Standard Library, check it out!