{"id":2387,"date":"2016-08-03T15:57:58","date_gmt":"2016-08-03T19:57:58","guid":{"rendered":"https:\/\/www.globo.tech\/learning-center\/?p=2387"},"modified":"2017-12-12T15:49:22","modified_gmt":"2017-12-12T20:49:22","slug":"install-go-1-6-centos-7","status":"publish","type":"post","link":"https:\/\/www.globo.tech\/learning-center\/install-go-1-6-centos-7\/","title":{"rendered":"How to Install Go 1.6 on CentOS 7"},"content":{"rendered":"<h1>How to Install Go 1.6 on CentOS 7<\/h1>\n<p>In 2007, Google created a language called Go, an ALGOL-like language. It&#8217;s compiled and statically typed, and like most modern languages has garbage collection and is memory safe. In 2009 Google released this open source language to the general public, licensing it under the BSD.<\/p>\n<h2>Getting started<\/h2>\n<p>Confirm that you have the following before you follow this guide:<br \/>\n\u2022 1 Node (<a href=\"https:\/\/www.globo.tech\/cloud-server-pricing\" target=\"_blank\">Cloud Server<\/a> or <a href=\"http:\/\/www.globo.tech\/dedicated-server-hosting\" target=\"_blank\">Dedicated Server<\/a>) running CentOS 7.<br \/>\n\u2022 Root access to the node or one sudo non-root user<\/p>\n<p>For the purpose of keeping this guide short, we&#8217;ll perform all commands with the root user. In a production environment, make sure to run your scripts and application inside an user instead.<\/p>\n<p>Note that the official repository for CentOS 7 only includes Go 1.4.2. Install from source to get the latest version.<\/p>\n<h2>Step-by-step guide<\/h2>\n<p>Before we start, make sure your system is fully updated with the latest packages by running this command:<\/p>\n<p><code>yum -y update<\/code><\/p>\n<h2>Installing the Go 1.6 files on your server<\/h2>\n<p>Here we will provide two different ways to install the Go programming language on your server. First we will show you how to install it via a package repository and then we will show you how to install it from source. <\/p>\n<p>Installing from a repository is the quickest and easiest method. It also provides you the most stable version to date. Installing from source will get you the latest version, but it may be more difficult. Therefore, choose the more appropriate method for your needs.<\/p>\n<p><code class=\"rouge\">Note: The official repository for CentOS 7 only includes Go 1.4.2. This is just fine for most purposes, but if you need the bleeding-edge version of Go, then install it from source.<\/code><\/p>\n<h2>Installing Go from package repositories<\/h2>\n<p>Go is located in the official repositories. Install the Go package and its dependencies.<\/p>\n<p><code>yum install golang<\/code><\/p>\n<p>Verify the version number.<\/p>\n<p><code>root@go-node:~# go version<br \/>\ngo version go1.4.2 linux\/amd64<\/code><\/p>\n<h2>Installing Go 1.6 from source<\/h2>\n<p>First, navigate to the root folder and download the Go source.<\/p>\n<p><code>cd ~<br \/>\nwget https:\/\/storage.googleapis.com\/golang\/go1.6.linux-amd64.tar.gz<\/code><\/p>\n<p>Extract the source and afterwards adjust its permissions.<\/p>\n<p><code>tar -zxvf go1.6.linux-amd64.tar.gz<br \/>\nchown -R root:root go<\/code><\/p>\n<p>Now, move the go directory to \/usr\/local.<\/p>\n<p><code>mv go \/usr\/local<\/code><\/p>\n<p>Create a directory to deploy your Go-built applications.<\/p>\n<p><code>mkdir \/root\/app<\/code><\/p>\n<p>In order to run Go 1.6, you must properly configure its paths. Add these two lines at the bottom of the file:<\/p>\n<p><code>nano ~\/.profile<\/code><\/p>\n<p><code class=\"gris\">export GOPATH=$HOME\/app<br \/>\nexport PATH=$PATH:\/usr\/local\/go\/bin:$GOPATH\/bin<\/code><\/p>\n<p>Activate the changes by this method.<\/p>\n<p><code>source ~\/.profile<\/code><\/p>\n<p>Finally, test your Go installation.<\/p>\n<p><code>go version<\/code><\/p>\n<p>Verify the version number like so:<\/p>\n<p><code class=\"gris\">go version go1.6 linux\/amd64<\/code><\/p>\n<h2>Conclusion<\/h2>\n<p>Whether you installed from the repository or from source, you should now have a successful installation of Go to experiment with. If this guide was helpful to you, kindly share it with others who may also be interested. <\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>How to Install Go 1.6 on CentOS 7 In 2007, Google created a language called Go, an ALGOL-like language. It&#8217;s compiled and statically typed, and like most modern languages has garbage collection and is memory safe. In 2009 Google released this open source language to the general public, licensing it under the BSD. Getting started<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[70],"tags":[],"class_list":["post-2387","post","type-post","status-publish","format-standard","hentry","category-web-hosting","operating_system-centos-7"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Install Go 1.6 on CentOS 7 - Globo.Tech<\/title>\n<meta name=\"description\" content=\"This tutorial will show you how to install Go 1.6 on your CentOS 7 server. Read now &amp; Enjoy this open-source modern programming language.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.globo.tech\/learning-center\/install-go-1-6-centos-7\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install Go 1.6 on CentOS 7 - Globo.Tech\" \/>\n<meta property=\"og:description\" content=\"This tutorial will show you how to install Go 1.6 on your CentOS 7 server. Read now &amp; Enjoy this open-source modern programming language.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.globo.tech\/learning-center\/install-go-1-6-centos-7\/\" \/>\n<meta property=\"og:site_name\" content=\"Globo.Tech\" \/>\n<meta property=\"article:published_time\" content=\"2016-08-03T19:57:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-12T20:49:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/GloboTech-Logo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"963\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"GloboTech Communications\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"GloboTech Communications\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/install-go-1-6-centos-7\/\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/install-go-1-6-centos-7\/\",\"name\":\"How to Install Go 1.6 on CentOS 7 - Globo.Tech\",\"isPartOf\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\"},\"datePublished\":\"2016-08-03T19:57:58+00:00\",\"dateModified\":\"2017-12-12T20:49:22+00:00\",\"author\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\"},\"description\":\"This tutorial will show you how to install Go 1.6 on your CentOS 7 server. Read now & Enjoy this open-source modern programming language.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/install-go-1-6-centos-7\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.globo.tech\/learning-center\/install-go-1-6-centos-7\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/install-go-1-6-centos-7\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.globo.tech\/learning-center\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install Go 1.6 on CentOS 7\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/\",\"name\":\"Globo.Tech\",\"description\":\"Welcome to the Official Globo.Tech Learning Center\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\",\"name\":\"GloboTech Communications\",\"sameAs\":[\"http:\/\/www.gtcomm.net\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install Go 1.6 on CentOS 7 - Globo.Tech","description":"This tutorial will show you how to install Go 1.6 on your CentOS 7 server. Read now & Enjoy this open-source modern programming language.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.globo.tech\/learning-center\/install-go-1-6-centos-7\/","og_locale":"en_US","og_type":"article","og_title":"How to Install Go 1.6 on CentOS 7 - Globo.Tech","og_description":"This tutorial will show you how to install Go 1.6 on your CentOS 7 server. Read now & Enjoy this open-source modern programming language.","og_url":"https:\/\/www.globo.tech\/learning-center\/install-go-1-6-centos-7\/","og_site_name":"Globo.Tech","article_published_time":"2016-08-03T19:57:58+00:00","article_modified_time":"2017-12-12T20:49:22+00:00","og_image":[{"width":1920,"height":963,"url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/GloboTech-Logo.png","type":"image\/png"}],"author":"GloboTech Communications","twitter_misc":{"Written by":"GloboTech Communications","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.globo.tech\/learning-center\/install-go-1-6-centos-7\/","url":"https:\/\/www.globo.tech\/learning-center\/install-go-1-6-centos-7\/","name":"How to Install Go 1.6 on CentOS 7 - Globo.Tech","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/#website"},"datePublished":"2016-08-03T19:57:58+00:00","dateModified":"2017-12-12T20:49:22+00:00","author":{"@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"description":"This tutorial will show you how to install Go 1.6 on your CentOS 7 server. Read now & Enjoy this open-source modern programming language.","breadcrumb":{"@id":"https:\/\/www.globo.tech\/learning-center\/install-go-1-6-centos-7\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.globo.tech\/learning-center\/install-go-1-6-centos-7\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.globo.tech\/learning-center\/install-go-1-6-centos-7\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.globo.tech\/learning-center\/"},{"@type":"ListItem","position":2,"name":"How to Install Go 1.6 on CentOS 7"}]},{"@type":"WebSite","@id":"https:\/\/www.globo.tech\/learning-center\/#website","url":"https:\/\/www.globo.tech\/learning-center\/","name":"Globo.Tech","description":"Welcome to the Official Globo.Tech Learning Center","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87","name":"GloboTech Communications","sameAs":["http:\/\/www.gtcomm.net"]}]}},"_links":{"self":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2387","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/comments?post=2387"}],"version-history":[{"count":5,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2387\/revisions"}],"predecessor-version":[{"id":3991,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2387\/revisions\/3991"}],"wp:attachment":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media?parent=2387"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/categories?post=2387"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/tags?post=2387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}