Edukasi

How To Install Golang 1.14 on CentOS 8 | CentOS 7

Go, commonly referred as Golang is a modern open source programming language for building reliable, simple and efficient software applications. Go powers popular applications such as Kubernetes, Prometheus, Docker, Terraform, Sensu and many others.

This tutorial will walk you through the installation of Go 1.14 on CentOS 8 / CentOS 7 Linux system.

Install Go 1.14 on CentOS 8 | CentOS 7

In this guide we’ll use a simple bash script created by Jorge Canha to install Go on CentOS 8 / CentOS 7 Linux machine. The script will download and install Go language under of your own user account.

Download script.

--- With curl ---
curl -O https://raw.githubusercontent.com/canha/golang-tools-install-script/master/goinstall.sh

--- With wget ---
wget https://raw.githubusercontent.com/canha/golang-tools-install-script/master/goinstall.sh

Make the script executable.

$ chmod +x goinstall.sh

If you run the script without passing version in option, it will download the latest release.

./goinstall.sh

To install specific version, pass the version number to –version argument.

--- Install Go 1.14 ---
$ ./goinstall.sh --version  1.14

--- Install Go 1.13 ---
$ ./goinstall.sh --version  1.13

Installation output:

...
esolving storage.googleapis.com (storage.googleapis.com)... 2a00:1450:400f:808::2010, 216.58.211.144
Connecting to storage.googleapis.com (storage.googleapis.com)|2a00:1450:400f:808::2010|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 120050424 (114M) [application/octet-stream]
Saving to: ‘/tmp/tmp.vlZUgncsKp/go.tar.gz’

100%[==============================================================================================================>] 120,050,424 34.4MB/s   in 3.3s   

2020-06-12 00:46:12 (34.4 MB/s) - ‘/tmp/tmp.vlZUgncsKp/go.tar.gz’ saved [120050424/120050424]

Extracting File...

Go 1.14 was installed into /root/.go.
Make sure to relogin into your shell or run:

 source /root/.bashrc

to update your environment variables.
Tip: Opening a new terminal window usually just works. :)

Source your bashrc file.

source /root/.bashrc

Confirm GOPATH is configured.

$ echo $GOPATH
/root/.bashrc

Confirm Go version installed on CentOS 7:

$ go version
go version go1.14 linux/amd64

Uninstall Go on CentOS 8 | CentOS 7

The same script can be used to install Go on CentOS 8 | CentOS 7:

$ ./goinstall.sh  --remove
Go removed.

Enjoy developing world changing applications with Go.

ryan

Recent Posts

Komputer Lemot? Gunakan MiniOS Ultra, Distro Linux dengan Fitur yang Cukup Lengkap

Jika merasa frustasi karena komputer atau laptop kamu hanya sanggup menjalankan aplikasi sederhana seperti browser…

6 hari ago

Games Nostalgia PS1 Tamiya Let’s & Go!! Eternal Wings (Japan)

Bakusou Kyoudai Lets & Go Eternal Wings atau biasa disebut dengan Game Tamiya PS1 merupakan permainan balap mobil Mini…

2 minggu ago

Cara Tambahkan Stiker Add Yours di WhatsApp Status

WhatsApp Status kembali mendapatkan fitur baru. Setelah cukup lama diuji coba, WhatsApp akhirnya merilis fitur 'Add…

3 minggu ago

Mark Zuckerberg Ingin AI Jadi Teman untuk Orang yang Kesepian

Chatbot AI saat ini sudah umum dipakai menjadi asisten digital. Tapi menurut Mark Zuckerberg, AI juga bisa…

3 minggu ago

Polytron Itu Mobil Listrik Nasional atau Bukan?

Polytron jadi merek Indonesia yang terjun dalam industri mobil listrik. Polytron disebut-sebut bakal menjadi mobil…

3 minggu ago

Pesaing China Muncul, Bikin AI Pakai GPU Murah Meriah

Fastino, startup kecerdasan buatan asal Amerika Serikat, memamerkan model AI barunya yang ditujukan untuk bisnis. Menariknya, model AI…

3 minggu ago