Lädt...

🕵️ How to Install Golang in Linux [New 2023 Method]


Nachrichtenbereich: 🕵️ Hacking
🔗 Quelle: kalilinux.in

Golang or Go is a new generation programming language many new tools like Modlishka, Gobuster and more comes written in Golang. Now Golang didn't comes pre-installed with our Kali Linux machine. In this detailed article we learn how to install Golang in Kali Linux in 2020.

There is two ways to install Golang in Linux system.
  1. From the Repository (If Go available in repo).
  2. Manual Install (Works always) .

install golang in Kali Linux

Installing Golang from repository

Previously we need to install Golang manually but now Golang is on Kali Linux's repository to install it we need to run following command:
sudo apt-get install -y golang
The installation process will took some time depending on internet speed and processing power of our machine.

Installing Golang from repository
Installing Golang from repository

Configure

After the installation process is done we need to configure a little bit in our .bashrc file. We open the .bashrc file by using following command:
sudo mousepad ~/.bashrc
Then we paste these following paths at the end of .bashrc file

# Golang paths in bashrc
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

Then we save and close .bashrc file. Then we reload and update the .bashrc by using following command:
source .bashrc


Checking Installation

Now we are ready to go. To check if it is everything working perfectly or not we should crate a "hello world" file in go language and run it.
sudo mousepad helloworld.go
Then we add the following code into the file:

package main
import "fmt"
func main() {
fmt.Printf("Hello world!\n")
}

Then we save the file and run it by using following command:
go run helloworld.go
If everything is alright then we got a 'Hello World!' output.

Installing Golang manually

If there is any problem to install it from the repository we can install it from manually.

First we open a browser and go to the official download page of Golang to download it:

Download golang from official website
Download Golang from official website

Then we click in the Linux download as shown in above screenshot to start the download process. The download is almost 120 MB.

The compressed file of Golang will be downloaded to our Downloads folder. We open a terminal window, and to navigate to Downloads folder we use following command:
cd Downloads
Then we type following command to extracts the files:
tar -C /usr/local/ -xzf go*.tar.gz
Above command will extract the Golang in our /usr/local directory.

Configuring Golang

We need to add variables for Golang by modifying the ~/.bashrc file.

First we open the file on our mousepad text editor by using following command:
sudo mousepad ~/.bashrc
Then we paste these following paths at the end of .bashrc file

# Golang paths in bashrc
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

Then we save and close .bashrc file. Then we reload and update the .bashrc by using following command:
source ~/.bashrc
Then we can check the installation is correct or not as the process mentioned above (try the same helloworld.go).


In the above described ways we can install Golang manually and from the repository. This now looks so essential because some grate cyber security weapons are available in Golang.

Enjoyed our articles ? Make sure to follow us on Twitter and GitHub, we post article updates there. To join our KaliLinuxInfamily, join our Telegram Group. We are trying to build a community for Linux and Cybersecurity. For anything we always happy to help everyone on the comment section. As we know our comment section is always open to everyone. We read each and every comment and we always reply.
...

🕵️ How to Install Golang in Linux [New 2023 Method]


📈 35.44 Punkte
🕵️ Hacking

🔧 Golang: Practical Cases to Use the Golang Sleep Method


📈 32.53 Punkte
🔧 Programmierung

🔧 Exploring Golang: Insights from the Latest Golang Nugget


📈 22.58 Punkte
🔧 Programmierung

🔧 GoLang JWT Authentication Using Golang Gin Framework with MongoDB


📈 22.58 Punkte
🔧 Programmierung

🔧 How to use GoLang in Flutter Application - Golang FFI


📈 22.58 Punkte
🔧 Programmierung

🕵️ GitHub Security Lab: Golang : Improvements to Golang SSRF query


📈 22.58 Punkte
🕵️ Sicherheitslücken

🔧 Golang Web: POST Method


📈 21.23 Punkte
🔧 Programmierung

🔧 Golang Web: PATCH Method


📈 21.23 Punkte
🔧 Programmierung

📰 How to Install Go (Golang) on Ubuntu Linux Step-by-Step


📈 19.9 Punkte
🐧 Unix Server

📰 How to install Go [golang] on Ubuntu Linux


📈 19.9 Punkte
📰 IT Security Nachrichten

🔧 How does the limit() method differ from the skip() method in streams?


📈 19.88 Punkte
🔧 Programmierung

🔧 Polymorphism in Python: Exploring Method Overloading and Method Overriding


📈 19.88 Punkte
🔧 Programmierung

🔧 Deprecated .fillna(method="ffill") method in pandas discovered


📈 19.88 Punkte
🔧 Programmierung

🔧 Understanding Frequency Count Method and Akra-Bazzi Method in Algorithm Analysis


📈 19.88 Punkte
🔧 Programmierung

🔧 C# dagi Method overload va Method group.


📈 19.88 Punkte
🔧 Programmierung

🔧 JavaScript Object Method and String Method


📈 19.88 Punkte
🔧 Programmierung

🔧 Method Overloading vs Method Overriding in Java – What's the Difference?


📈 19.88 Punkte
🔧 Programmierung

🔧 Difference between Census Method and Sampling Method of Collecting Data


📈 19.88 Punkte
🔧 Programmierung

🕵️ Method Method Camtasia 2019 Unlimited


📈 19.88 Punkte
🕵️ Hacking

🔧 DAY-14 -Static method and Non static method..


📈 19.88 Punkte
🔧 Programmierung

🔧 [Solved] Swift Compiler Error (Xcode): Method does not override any method from its superclass


📈 19.88 Punkte
🔧 Programmierung

🔧 what diffrient between GET method POST method and


📈 19.88 Punkte
🔧 Programmierung

📰 Debian-Based Slax 9.4 Linux OS Adds Easier App Install Method, More Improvements


📈 18.55 Punkte
📰 IT Security Nachrichten

📰 Debian-Based Slax 9.4 Linux OS Adds Easier App Install Method, More Improvements


📈 18.55 Punkte
📰 IT Security Nachrichten

🔧 What Are the Steps to Install Golang on Macos in 2025?


📈 17.62 Punkte
🔧 Programmierung