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:
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
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.
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.