* fix: replace sh with shell fix replace terminal with shell fix replace node with js fix replace output with shell fix replace cs with csharp fix replace c++ with cpp fix replace c# with csharp fix replace javasctipt with js fix replace syntax with js fix replace unix with shell fix replace linux with shell fix replace java 8 with java fix replace swift4 with swift fix replace react.js with jsx fix replace javascriot with js fix replace javacsript with js fix replace c++ - with cpp fix: corrected various typos fix: replace Algorithm with nothing fix: replace xaml with xml fix: replace solidity with nothing fix: replace c++ with cpp fix: replace txt with shell fix: replace code with json and css fix: replace console with shell
2.6 KiB
title
title |
---|
Installing Go in Ubuntu using a tarball |
Installing Go in Ubuntu using a tarball
This is the recommended way to install go if you wish to get the latest stable version available from the golang website.
Check your system Architecture
Before proceeding make sure you know if your system is 32 or 64 bit. If you don't know, run the following command to find out:
$ lscpu | grep Architecture
If you see Architecture: x86_64
your system is 64bit, otherwise if you get Architecture: i686
, then your system is 32bit. Now that you know your system architecture, let's proceed.
Picking the right tarball
From the golang download page, you'll need to get the link to the right tarball file (.tar.gz) for your system.
If your system is 64bit, copy the link to the .tar.gz file for Linux systems with x86_64 architecture. For example, the latest stable version for 64bit systems as of this writing is go1.9.1.linux-amd64.tar.gz
If your system is 32bit, copy the link to the .tar.gz file for Linux systems with x86 architecture. As of this writing the latest file is go1.9.1.linux-386.tar.gz
After copying the link, simply replace the link in the Installation process found below with the link you got from the download page.
Installation Process
In this installation process we'll use the links to the go 1.9.1 tarballs as an example. 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.
Go 1.9.1 for 64bit systems:
$ wget https://storage.googleapis.com/golang/go1.9.1.linux-amd64.tar.gz
$ sudo tar -C /usr/local -xzf go1.9.1.linux-amd64.tar.gz
$ export PATH=$PATH:/usr/local/go/bin
Go 1.9.1 for 32bit systems:
$ wget https://storage.googleapis.com/golang/go1.9.1.linux-386.tar.gz
$ sudo tar -C /usr/local -xzf go1.9.1.linux-386.tar.gz
$ export PATH=$PATH:/usr/local/go/bin
Check installation and version of go
To check if go was successfully installed, use:
$ go version
> go version go1.9.1 linux/amd64
This will print to the console the version of go, while at the same time making sure the installation went smoothly.