{"id":2973,"date":"2014-10-22T13:33:00","date_gmt":"2014-10-22T11:33:00","guid":{"rendered":"http:\/\/supportex.net\/blog\/?p=2973"},"modified":"2019-05-10T14:24:17","modified_gmt":"2019-05-10T12:24:17","slug":"go-install-centos-6-5","status":"publish","type":"post","link":"https:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/","title":{"rendered":"Go: how to install on Centos 6.5"},"content":{"rendered":"<p>Go is a quite new programming language. It was developed\u00a0 in 2007 by <a title=\"Robert Griesemer\" href=\"http:\/\/en.wikipedia.org\/wiki\/Robert_Griesemer\">Robert Griesemer<\/a>, <a title=\"Rob Pike\" href=\"http:\/\/en.wikipedia.org\/wiki\/Rob_Pike\">Rob Pike<\/a>, and <a title=\"Ken Thompson\" href=\"http:\/\/en.wikipedia.org\/wiki\/Ken_Thompson\">Ken Thompson<\/a>. Although it&#8217;s not as mature as C, Python or Java, it has already gained significant popularity in developers community. For instance, Docker is written in Go. It&#8217;s also in active use in Dropbox, Canonical and definitely in <a href=\"http:\/\/golang.org\/doc\/faq#Is_Google_using_go_internally\">Google<\/a>. CoreOS uses Go as well. If you would like to give it a shoot, first thing you need to do is to install it. \u00a0The easiest way to install is to use standard package manager, as apt-get for Ubuntu \/ Debian or yum (Fedora). \u00a0But if you need it on Centos, it&#8217;s not that easy. \u00a0Although Go developers provide binary packages, we&#8217;d like to install RPM package. It make everything much easier later when you need to update it or uninstall. You can write your own spec file, but it&#8217;s much easier to user the <a href=\"https:\/\/gist.github.com\/jehiah\/3867005\">SPEC file <\/a>\u00a0prepared by\u00a0<a href=\"https:\/\/github.com\/jehiah\">Jehiah Czebotar<\/a>. The only thing we need is to modify current version. At the time of writing it&#8217;s\u00a0go1.3.3.linux-amd64.tar.gz. We assume you have your environment prepared for RPM building.<\/p>\n<p>Go to your SPEC directory and download the SPEC file.<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">wget https:\/\/gist.githubusercontent.com\/jehiah\/3867005\/raw\/f5190c21a40ffedcbbcd020405c0f50e57287e0e\/go.spec<\/code><\/p>\n<p>Modify the version to match the current one:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">Source0: go1.3.3.linux-amd64.tar.gz<\/code><\/p>\n<p>cd to your ~\/SOURCES and download the sources codes:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">wget https:\/\/storage.googleapis.com\/golang\/go1.3.3.linux-amd64.tar.gz<\/code><\/p>\n<p>We are ready to build Go:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">rpmbuild -bb ~\/rpmbuild\/SPECS\/go.spec<\/code><\/p>\n<p>Let&#8217;s check if everything is ok:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[root@dev ~]# rpm -ivh --test rpmbuild\/RPMS\/x86_64\/go-devel-go1.3.3-1.x86_64.rpm\nPreparing...                ########################################### [100%]\n[root@dev ~]#\n<\/pre>\n<p>If it is install Go rpm:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">rpm -ivh rpmbuild\/RPMS\/x86_64\/go-devel-go1.3.3-1.x86_64.rpm<\/code><\/p>\n<p>Update your bash env variable to make sure it knows where go is:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[root@dev ~]# bash\n[root@dev ~]# which go\n\/\/usr\/local\/go\/bin\/go\n[root@dev ~]#\n<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[root@dev ~]# go version\ngo version go1.3.3 linux\/amd64\n[root@dev ~]#\n\n<\/pre>\n<p>So far so good. Create an example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[root@dev ~]# cat hi.go\npackage main\nimport \"fmt\"\nfunc main() {\n    fmt.Println(\"hello world\")\n}\n[root@dev ~]#<\/pre>\n<p>To build and launch run:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[root@dev ~]# go run hi.go\nhello world\n[root@dev ~]#<\/pre>\n<p>Now we can dive in Go world. Good start point can be found at <a href=\"https:\/\/gobyexample.com\">gobyexample.com<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Go is a quite new programming language. It was developed\u00a0 in 2007 by Robert Griesemer, Rob Pike, and Ken Thompson. Although it&#8217;s not as mature as C, Python or Java, it has already gained significant popularity in developers community. For instance, Docker is written in Go. It&#8217;s also in active use in Dropbox, Canonical and&hellip; <\/p>\n<div class=\"readmore-wrapper\"><a href=\"https:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/\" class=\"more-link\">Read <\/a><\/div>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[152],"tags":[157,158,275],"class_list":["post-2973","post","type-post","status-publish","format-standard","hentry","category-linux","tag-go","tag-golang","tag-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Go: how to install on Centos 6.5 &#8211; Supportex.NET blog<\/title>\n<meta name=\"description\" content=\"How to install GO on CentOS 6.5. Setup GO on CentOS. Golang CentOS.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Go: how to install on Centos 6.5 &#8211; Supportex.NET blog\" \/>\n<meta property=\"og:description\" content=\"How to install GO on CentOS 6.5. Setup GO on CentOS. Golang CentOS.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/\" \/>\n<meta property=\"og:site_name\" content=\"Supportex.NET blog\" \/>\n<meta property=\"article:published_time\" content=\"2014-10-22T11:33:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-05-10T12:24:17+00:00\" \/>\n<meta name=\"author\" content=\"Oleksii Tykhonov\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Oleksii Tykhonov\" \/>\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\":\"Article\",\"@id\":\"https:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/\"},\"author\":{\"name\":\"Oleksii Tykhonov\",\"@id\":\"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251\"},\"headline\":\"Go: how to install on Centos 6.5\",\"datePublished\":\"2014-10-22T11:33:00+00:00\",\"dateModified\":\"2019-05-10T12:24:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/\"},\"wordCount\":286,\"commentCount\":0,\"keywords\":[\"go\",\"golang\",\"linux\"],\"articleSection\":[\"linux\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/\",\"url\":\"https:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/\",\"name\":\"Go: how to install on Centos 6.5 &#8211; Supportex.NET blog\",\"isPartOf\":{\"@id\":\"https:\/\/supportex.net\/blog\/en\/#website\"},\"datePublished\":\"2014-10-22T11:33:00+00:00\",\"dateModified\":\"2019-05-10T12:24:17+00:00\",\"author\":{\"@id\":\"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251\"},\"description\":\"How to install GO on CentOS 6.5. Setup GO on CentOS. Golang CentOS.\",\"breadcrumb\":{\"@id\":\"https:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/supportex.net\/blog\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Go: how to install on Centos 6.5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/supportex.net\/blog\/en\/#website\",\"url\":\"https:\/\/supportex.net\/blog\/en\/\",\"name\":\"Supportex.NET blog\",\"description\":\"Server and network management company\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/supportex.net\/blog\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251\",\"name\":\"Oleksii Tykhonov\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4fd5f58002717075c88963469b9babef?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4fd5f58002717075c88963469b9babef?s=96&d=mm&r=g\",\"caption\":\"Oleksii Tykhonov\"},\"url\":\"https:\/\/supportex.net\/blog\/author\/oleksiitykhonov\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Go: how to install on Centos 6.5 &#8211; Supportex.NET blog","description":"How to install GO on CentOS 6.5. Setup GO on CentOS. Golang CentOS.","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:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/","og_locale":"en_US","og_type":"article","og_title":"Go: how to install on Centos 6.5 &#8211; Supportex.NET blog","og_description":"How to install GO on CentOS 6.5. Setup GO on CentOS. Golang CentOS.","og_url":"https:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/","og_site_name":"Supportex.NET blog","article_published_time":"2014-10-22T11:33:00+00:00","article_modified_time":"2019-05-10T12:24:17+00:00","author":"Oleksii Tykhonov","twitter_misc":{"Written by":"Oleksii Tykhonov","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/#article","isPartOf":{"@id":"https:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/"},"author":{"name":"Oleksii Tykhonov","@id":"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251"},"headline":"Go: how to install on Centos 6.5","datePublished":"2014-10-22T11:33:00+00:00","dateModified":"2019-05-10T12:24:17+00:00","mainEntityOfPage":{"@id":"https:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/"},"wordCount":286,"commentCount":0,"keywords":["go","golang","linux"],"articleSection":["linux"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/","url":"https:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/","name":"Go: how to install on Centos 6.5 &#8211; Supportex.NET blog","isPartOf":{"@id":"https:\/\/supportex.net\/blog\/en\/#website"},"datePublished":"2014-10-22T11:33:00+00:00","dateModified":"2019-05-10T12:24:17+00:00","author":{"@id":"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251"},"description":"How to install GO on CentOS 6.5. Setup GO on CentOS. Golang CentOS.","breadcrumb":{"@id":"https:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/supportex.net\/blog\/2014\/10\/go-install-centos-6-5\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/supportex.net\/blog\/en\/"},{"@type":"ListItem","position":2,"name":"Go: how to install on Centos 6.5"}]},{"@type":"WebSite","@id":"https:\/\/supportex.net\/blog\/en\/#website","url":"https:\/\/supportex.net\/blog\/en\/","name":"Supportex.NET blog","description":"Server and network management company","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/supportex.net\/blog\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251","name":"Oleksii Tykhonov","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/4fd5f58002717075c88963469b9babef?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4fd5f58002717075c88963469b9babef?s=96&d=mm&r=g","caption":"Oleksii Tykhonov"},"url":"https:\/\/supportex.net\/blog\/author\/oleksiitykhonov\/"}]}},"_links":{"self":[{"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/posts\/2973","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/comments?post=2973"}],"version-history":[{"count":5,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/posts\/2973\/revisions"}],"predecessor-version":[{"id":3118,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/posts\/2973\/revisions\/3118"}],"wp:attachment":[{"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/media?parent=2973"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/categories?post=2973"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/tags?post=2973"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}