How to Install Go (Golang) on Ubuntu 25.10

Go, commonly known as Golang, is a modern and highly efficient programming language developed by engineers at Google. It has gained popularity for its clean syntax, ease of concurrent programming with goroutines, static typing, fast compilation, and cross-platform support. With a robust standard library and excellent tooling, Go is well-suited for web development, system programming, microservices, and cloud infrastructures.

In this guide, we’ll walk through how to install the latest stable Go version (v1.25.0) on Ubuntu 25.10 using tarball installation, which ensures you get the most up-to-date release.

Update the System

First, update your Ubuntu package list and upgrade existing packages:

sudo apt update -y
sudo apt upgrade -y

Remove Any Previous Go Installation (Optional but Recommended)

If you have an older Go version installed (for example via apt), it’s a good idea to remove it to avoid conflicts:

sudo rm -rf /usr/local/go
sudo apt remove --purge golang-go golang-1.* -y

Download the Latest Go Tarball

Visit the official Go downloads page or use the command below to fetch the latest release. At the time of writing, the latest stable version is go1.25.0. :contentReference[oaicite:1]{index=1}

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

Extract and Install Go

Extract the tarball into /usr/local:

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

Add /usr/local/go/bin to your PATH so that the go command is available globally. Edit your shell profile (for example ~/.bashrc or ~/.profile) and append:

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

Then reload your profile:

source ~/.bashrc

Verify the Installation

Check that Go has been installed properly and reports the expected version:

go version

Output:

go version go1.25.0 linux/amd64

Setting Up Your Go Workspace (Optional)

With newer Go modules, setting up a GOPATH is optional but still useful in some cases:

Edit your shell profile and add:

export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin

Then reload:

source ~/.bashrc

Test a Simple Go Program

Create a test directory and a simple "Hello, Go!" program:

mkdir -p ~/go-projects/hello
cd ~/go-projects/hello
nano hello.go

Add the following content:

package main

import "fmt"

func main() {
    fmt.Println("Hello, Golang!")
}

Run the program:

go run hello.go

You should see:

Hello, Golang!

Keep Go Updated

To update Go in the future:

  1. Remove the old /usr/local/go directory.
  2. Download the new Go tarball (e.g., go1.xx.x.linux-amd64.tar.gz).
  3. Extract into /usr/local.
  4. Verify go version.

Conclusion

You have now successfully installed Go 1.25.0 on Ubuntu 25.10. You can now build Go applications, use modules with go mod, and explore the powerful Go ecosystem. Happy coding!


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS