How to install Go on Debian 12

Endrit Qerreti

Endrit Qerreti

In this tutorial, you will learn how to install Go programming language on Debian 12.

Go language, is a programming language developed by Google.

Go is open source language, and it is used widely by developers all around the world.

Installing GO on Debian 12, can be done via different ways. However, in this tutorial, we'll be installing GO via the source manually on our machine running Debian 12.

Step 1 - Download GO

First, launch terminal and download GO by running the command below.

We are using wget to download GO. However, you can use any package you want.

wget https://go.dev/dl/go1.21.3.linux-amd64.tar.gz

Step 2 - Install GO

Once you have downloaded GO language, you can now proceed to install it on your Debian machine. Installing GO from the source is easy, all you have to do is to extract GO source into /usr/local directory

To do this, you need to set /usr/local as the directory where you want to extract all GO files

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

Step 3 - Set up GO Path

To be able to use GO language on your terminal, once installed, make sure to add GO path on your ~/.bashrc file.

You don't have to edit ~/.bashrc manually to achieve this, as you can do it easily by running the command below

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

Once you have added GO path on your file, you need to source ~/.bashrc in order to activate the new path

source ~/.bashrc

Step 4 - Verify GO Installation

Now you should be able to use GO on your machine. To check if GO installation was successful, you can call go on your terminal

go

Conclusion

In this tutorial, you learned how to install GO programming language on your Debian 12 machine.