How to install Golang on Ubuntu 20.04

Go is a new general purpose programming language that makes it easy to build simple, reliable, and efficient software. It has excellent tools for building web applications. Google built Go because the company needs a fast and flexible language that supports modern computer architectures and offers quality engineering combined with a senior team that understands how to build low-level systems. More than just an alternative to C, golang supports concurrency and parallelism in both CPU-bound and I/O bound applications.

Go is the newest open-source programming language created by Google as a replacement for other programming languages. Some of these programming languages include Java and C++, which are used by large companies such as Google and Apple respectively. With Go you can build web applications using the standard library net/html along with many other useful libraries to help develop your application faster than ever before.

In this article, we gonna show you how to install Go on Ubuntu 20.04

The first step is to download the latest go version from their official website by using the following command:

wget https://golang.org/dl/go1.17.1.linux-amd64.tar.gz

Now, extract it to the /usr/local directory with the following command:

sudo tar -C /usr/local -xzf go1.17.1.linux-amd64.tar.gz

Next, we need to add the go binary $PATH variable in /etc/profile directory

nano /etc/profile

Add the following line:

export PATH=$PATH:/usr/local/go/bin

Then save it by using CTRL+X then Y to save it.

Now use the following command to activate the PATH

source /etc/profile

Next, check if we successfully install go by using the following command:

go version

You should get the following output is you installed with success go

go version go1.17.1 linux/amd64

Leave a Reply