Go, also known as "Golang," is an open-source programming language released back in 2012. It was made by Google with the intention of making a language that could be easily learnt.

Over the years, Go has gained popularity among many programmers who use it to create various projects starting from cloud applications to artificial intelligence and robotics. It has also been used to create popular platforms such as Kubernetes, Prometheus, Docker and Terraform.

Go, is available for various operating systems such as Windows, Linux systems and macOS. This tutorial shows you how to install the GO programming language on the Ubuntu Linux distribution.

Let's get started.

Installation

Several methods can be used to install the Go programming language on an ubuntu system. You can use the apt repository, download the source code or install it using snap.

1. Using apt repository to Install Go

Start by opening the terminal window by pressing Ctrl + Alt + t . Once the terminal is open, update the packages list with the command below:

sudo apt update

This command will ensure that the package database is updated with more package lists so that everything is up to date and missing packages are downloaded.

After the update, install golang with the following command and press Enter.

sudo apt install golang -y

We use the -y flag to accept all the prompts. This command should install all the required Go dependencies to the system.

You can verify that Go is installed by checking the version with the following command.

go version

Output:

Img-1-1

2. Go Installation using Snap

The other method to install Go is using the snap application. The snap application allows you to install your preferred go version. Snaps are

You can check the list of go versions using the command below.

sudo snap info go

Output:

Img-2-1

You can select your preferred version from the lists and use Snap to install it.

The snap installation syntax is as follows.

sudo snap install go --classic --channel=version-no/stable

Where "version-no" is the version you choose.

Example:

sudo snap install go --classic --channel=1.20/stable 

Output:

Img-3-1

If you are unhappy with the choice of go installed, you can use the following command to upgrade or downgrade it.

sudo snap refresh go --classic --channel=1.19/stable

The command above downgrades go to version 1.19 from 1.20.

Img-4-1

3. Downloading the Source Code

You can also Install Go by downloading the source code from the official site and installing it manually. Check this article to see how to do it. How to install go using the source code

Ending

In this article, you have seen how to install golang using Snap and using the apt repository. Choose one of the methods and get started with development.

If you found the article useful, share it and consider subscribing to geekbits to get notified whenever we publish interesting articles.

Thanks for reading :)

If you enjoy our content, please consider buying us a coffee to support our work:

Go Convert Byte Array to String
For this one, we will discuss how yo convert a byte array into a string using various methods.
How to Connect Redis with Go
In this beginner-friendly tutorial, you will explore the basics of using Redis database with your Golang application.
How to install Golang on macOS
A short tutorial with instructions on how to install and setup the Go compiler on macOS.
Table of Contents
Great! Next, complete checkout for full access to GeekBits.
Welcome back! You've successfully signed in.
You've successfully subscribed to GeekBits.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info has been updated.
Your billing was not updated.