Categories: TutorialsUbuntu

How to install Golang on Ubuntu 22.04

Golang, also known as Go, is an open-source, cross-platform programming language compatible with various operating systems, including Linux, Windows, and macOS.

Tailored for professional application development, Go stands out for its simplicity in construction and management, making it an excellent choice for creating efficient software. It boasts reliability, swift builds, and the ability to scale software rapidly.

While Go’s code syntax bears a resemblance to C, it incorporates advanced features such as memory safety, structural typing, garbage collection, and more. Developed by Google engineers, Go is statically typed and generates compiled machine code binaries. Its popularity among developers is attributed to the fact that source code compilation isn’t necessary for creating executable files.

Sponsored

Read: How to install Python on Ubuntu 22.04

A noteworthy feature of Go is its concurrency mechanisms, facilitating the creation of programs that harness the full potential of multicore and networked PCs. Simultaneously, its novel-typed systems support flexible and modular program structures.

Go Installation using the APT command

Apt is a free-software user interface that collaborates with core libraries to manage the installation, upgrade, and removal of software on Linux operating systems. Follow these apt commands to install “Go” on Ubuntu 22.04.

Begin by updating the system packages repository in the terminal. Open the terminal using the “CTRL+ALT+T” key combination and execute the following command with sudo privileges:

sudo apt update

Once you have updated the apt database, proceed with the following command to install Go:

sudo apt install golang-go

To confirm the successful installation, check the version of “Go” by executing the “go version” command in the terminal:

go version

Read: How to use the APT command on Ubuntu/Debian Linux systems

Sponsored

Removing Go

If you need to uninstall Go for any reason, you can use the following apt command:

sudo apt-get remove golang-go

Go Installation Using snap

The Snap Store serves as a package management system designed for exploring, installing, and overseeing software. While it’s typically included in the default installation of various Linux operating systems, such as Ubuntu 22.04, you can employ the following steps if, for any reason, it is not present on your Ubuntu system.

To install Snap, execute the following command in the terminal:

sudo apt install snapd

Once this is done, run the command :

sudo snap install go –classic

Read: How to install Snap pack support on Linux

To uninstall Go from Ubuntu using Snap, enter the following command in the terminal:

sudo snap remove go

 

The post How to install Golang on Ubuntu 22.04 appeared first on net2.

Ubuntu Server Admin

Recent Posts

Canonical Releases Ubuntu 25.04 Plucky Puffin

The latest interim release of Ubuntu introduces “devpacks” for popular frameworks like Spring, along with…

2 days ago

Ubuntu 25.04 (Plucky Puffin) Released

Ubuntu 25.04, codenamed “Plucky Puffin”, is here. This release continues Ubuntu’s proud tradition of integrating…

3 days ago

Extended Security Maintenance for Ubuntu 20.04 (Focal Fossa) begins May 29, 2025

Ubuntu released its 20.04 (Focal Fossa) release 5 years ago, on March 23, 2020. As…

3 days ago

Ubuntu 20.04 LTS End Of Life – activate ESM to keep your fleet of devices secure and operational

Focal Fossa will reach the End of Standard Support in May 2025, also known as…

4 days ago

Ubuntu MATE 25.04 Release Notes

Ubuntu MATE 25.04 is ready to soar! 🪽 Celebrating our 10th anniversary as an official…

4 days ago

Ubuntu Weekly Newsletter Issue 887

Welcome to the Ubuntu Weekly Newsletter, Issue 887 for the week of April 6 –…

6 days ago