Install Go Language




How to Install Go (Golang) 1.25.5 on Linux

Here is a quick, no-nonsense guide to installing Go (specifically version 1.25.5) on your Linux machine.

Step 1: Download the Go Binary

First, we need to grab the official tarball. We will use wget to download the specific version for Linux AMD64.

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

Step 2: Remove Previous Installations

Before extracting the new version, it is best practice to remove any existing Go installations located in /usr/local/go. This prevents weird conflicts between version files.

Run the following command with sudo:

Bash
sudo rm -rf /usr/local/go

Step 3: Extract the Archive

Now, we extract the downloaded tarball to /usr/local. This creates a fresh Go tree in /usr/local/go.

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

Step 4: Configure Your Path (Crucial Step)

Even though the files are extracted, your system doesn't know where the go executable is yet. You need to add the Go binary directory to your $PATH.

  1. Open your profile file (usually $HOME/.profile or $HOME/.bashrc):

    Bash
    nano $HOME/.profile
    
  2. Add the following line to the end of the file:

    Bash
    export PATH=$PATH:/usr/local/go/bin
    
  3. Save the file and apply the changes immediately:

    Bash
    source $HOME/.profile
    

Step 5: Verify the Installation

Now that everything is set up, verify that Go is installed and reachable.

Bash
go version

Posting Komentar

advertise
advertise
advertise
advertise