How To Install Go 1.11.2 on Ubuntu 18.04

Go language 1.11.2 Installation on Ubuntu 18.04

Go is an elegant language with a clean and concise specifications that are readable and comprehensive. One of the major strengths of Golang is its concurrency, which means multiple process of the Go applications can run at same time. This tutorial covers the method to install Go 1.11.2 on Ubuntu 18.04.

Installation

First, you need to update the repository files by using the following command.

root@linuxhelp:~# apt-get update
Hit:1 http://in.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://ppa.launchpad.net/eugenesan/ppa/ubuntu bionic InRelease          
Hit:3 https://deb.nodesource.com/node_10.x bionic InRelease                   
Get:4 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]   
Get:5 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease [20.8 kB]   
Get:6 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]  
Get:7 http://APT.spideroak.com/ubuntu-spideroak-hardy release InRelease [2,547
.
.
.
Get:28 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 64x64 Icons [322 kB]
Get:29 http://in.archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2,464 B]
Get:30 http://in.archive.ubuntu.com/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [5,812 B]
Reading package lists... Done  

Once it is done, ensure you download the golang packages with wget command as follows.

root@linuxhelp:~#wget -q https://storage.googleapis.com/golang/getgo/installer_linux

After that, give the permission to the golang packages by running the following command.

root@linuxhelp:~# chmod +x installer_linux

You can now install the golang packages by using the following command.

root@linuxhelp:~# ./installer_linux
Welcome to the Go installer!
Downloading Go version go1.11.2 to /root/.go
This may take a bit of time...
Downloaded!
Setting up GOPATH
GOPATH has been set up!

One more thing! Run `source /root/.bash_profile` to persist the
new environment variables to your current session, or open a
new shell prompt.

You can load Golang functions file into the current shell script by using the following command.

root@linuxhelp:~# source /root/.bash_profile

If you want to find the version of Golang which you have just installed, run the following command.

root@linuxhelp:~# go version
go version go1.11.2 linux/amd64

With this, the method to install Go on Ubuntu 18.04 comes to an end.

FAQ
Q
Is Golang development cost effective?
A
Yes, because of the way Golang was designed, developing applications with Golang is extremely productive and efficient and results in safe software without runtime surprises. While having much better performance, Golang applications use fewer server resources than other web development languages, like PHP and Python.

Development with Golang saves you time and money with

Development productivity
Maintenance
Performance
Less server resources
Q
Is Golang the right choice for every application?
A
No. Although Golang is well suited to many use cases, there are some applications that don’t require high performance or that could be better implemented in another language, like C, C# or Java, all of which we have decades of experience with.
Q
How will Golang development benefits?
A
Development with Golang costs less from the start. In addition to the performance increase, often more than 400%, Golang applications are quicker to develop, easier to maintain, safer and less prone to having runtime errors.
Q
Does Go language have a runtime?
A
Go does have an extensive library, called the runtime, that is part of every Go program. The runtime library implements garbage collection, concurrency, stack management, and other critical features of the Go language. Although it is more central to the language, Go's runtime is Analogous to libc, the C library.
Q
What is Golang?
A
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.