How to Install Go on Ubuntu!

How to Install Go on Ubuntu!

Written by Adam. R on Sep 18th, 2021 Views Report Post

What is GO?

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.


Installation

Step 1. Downloading the Go tarball

At the time of writing this article, the latest stable version of Go is version 1.14.2. Before downloading the tarball, visit the official Go downloads page and check if there is a new version available.

Link: https://golang.org/dl/

Run the following command as a user with sudo privileges to download and extract the Go binary archive in the /usr/local directory:

wget -c https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local

Step 2. Adjusting the Path Variable

By adding the location of the Go directory to the $PATH environment variable, the system will know where to find the Go executable binaries.

This can be done by appending the following line either to the /etc/profile file (for a system-wide installation) or the $HOME/.profile file (for a current user installation):

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

Save the file, and load the new PATH environment variable into the current shell session:

source ~/.profile

Step 3. Verifying the Go Installation

Verify the installation by printing the Go version:

go version

Output

go version go1.14.2 linux/amd64

That’s it, you have successfully installed Go on your Ubuntu Server and you can start using it!

If you found this usful then please comment and follow me! Also check out my website where I also post everything from here

Comments (0)