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.
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:
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.
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.
Open your profile file (usually
$HOME/.profileor$HOME/.bashrc):Bashnano $HOME/.profileAdd the following line to the end of the file:
Bashexport PATH=$PATH:/usr/local/go/binSave the file and apply the changes immediately:
Bashsource $HOME/.profile
Step 5: Verify the Installation
Now that everything is set up, verify that Go is installed and reachable.
go version

Posting Komentar