How to Install Go in Arch Linux Using Pacman

Using the Arch Linux Package Manager (pacman) is the easiest way to install Go. Based on the Arch Linux philosophy of providing new software versions very fast, you will get a very current version of Go.

Before you can install the Go package, you have to bring the system and all of your installed packages up to date. However, before updating your system and its packages, remember to check the Arch Linux home page first. Any out-of-the-ordinary steps that you have to do to prevent packages from breaking will be listed in a post there.

Once you've confirmed that it's safe to update your system, just run the following command:

$ sudo pacman -Syu

Remember that the -S flag is used to install a single package or a list of packages, the y option refreshes the list of all Arch Linux packages, and the option u upgrades all packages that are out of date.

After your system is completely up to date, install Go with the following command:

$ sudo pacman -S go

Check the installation and version of Go

To check if Go was successfully installed, run:

$ go version
> go version go1.13.8 linux/amd64

This will print the installed version of Go to the console, while at the same time making sure the installation went smoothly.

More info about Go:

More info about Arch Linux:

Bonus: How to Install Go on Ubuntu / Linux Mint:

Using Ubuntu’s Source Package Manager (apt) is the easiest way to install Go. While Arch Linux's pacman is on the bleeding edge, packages installed using apt and its variants are often several versions behind.

The benefit of this approach is stability – while you won't be able to install the latest and greatest version of any package, you can be certain that your system won't break.

First, update your system with the following commands:

$ sudo apt update
$ sudo apt upgrade

Then install Go by running:

$ sudo apt install golang-go

Check the installation and version of Go

To check if Go was successfully installed, open your terminal and run:

Bonus: How to Install Go on macOS:

Installing Go in Mac OS X using Package Installer

Check the installation and version of Go

To check if Go was successfully installed, open your terminal and run:

$ go version

This will print the installed version of Go to the console.

Installing Go in Mac OS X using tarball

You can get the link to the Mac OS tarball archive from the Latest Stable section of the golang download page.

Installation Process

In this installation process we’ll use the latest stable version as of this writing (Go 1.9.1). For a newer or older version simply replace the link in the first step. Check the golang download page to see what versions are currently available.

Our mission: to help people learn to code for free. We accomplish this by creating thousands of
videos, articles, and interactive coding lessons - all freely available to the public. We also have
thousands of freeCodeCamp study groups around the world.

Donations to freeCodeCamp go toward our education initiatives, and help pay for servers, services,
and staff.