{"id":4604,"date":"2019-05-15T23:38:14","date_gmt":"2019-05-15T18:08:14","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=4604"},"modified":"2019-05-15T23:42:41","modified_gmt":"2019-05-15T18:12:41","slug":"how-to-install-go-on-centos-7","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/how-to-install-go-on-centos-7\/","title":{"rendered":"How to Install Go on CentOS-7"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">How to Install Go on CentOS &#8211; 7<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">Date Posted: 15\/05\/2019<\/h4>\n\n\n\n<h3 class=\"wp-block-heading\">Introduction<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Go, often referred to as <strong>golang<\/strong> is a ultra modern open source programming language created by <strong>Google<\/strong>. In day today life, many popular applications such as , Docker, Kubernetes and Hugo, are written in Go language.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this tutorial we will guide you how to download and install Go on a <strong>CentOS<\/strong> <strong>7<\/strong> environment.<\/p>\n\n\n\n<ul class=\"wp-block-gallery columns-1 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\"><li class=\"blocks-gallery-item\"><figure><img fetchpriority=\"high\" decoding=\"async\" width=\"520\" height=\"240\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/05\/Install-Go-on-CentOS.jpg\" alt=\"\" data-id=\"4620\" data-link=\"https:\/\/pheonixsolutions.com\/blog\/?attachment_id=4620\" class=\"wp-image-4620\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/05\/Install-Go-on-CentOS.jpg 520w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/05\/Install-Go-on-CentOS-300x138.jpg 300w\" sizes=\"(max-width: 520px) 100vw, 520px\" \/><\/figure><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Prerequesties<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"> For instance the latest stable version of Go is version 1.12.5. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Moreover before downloading the <strong>tarball<\/strong> visit the official of  Go\u00a0<a href=\"https:\/\/golang.org\/dl\/\" target=\"_blank\" rel=\"noopener\">downloads page<\/a>\u00a0and check if there is a new version available.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"> Follow the step by step procedure to install Go on CentOS 7:<\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li>Initially, download the tarball. <\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Therefore to download the Go binary use either\u00a0<strong>curl<\/strong> or <strong>wget<\/strong> command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget https:\/\/dl.google.com\/go\/go1.12.5.linux-amd64.tar.gz<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">2.  Most importantly, verify the tarball checksum with the\u00a0<code><strong>sha256sum<\/strong><\/code><strong>command<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sha256sum go1.12.5.linux-amd64.tar.gz<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>OUTPUT:\n\naea86e3c73495f205929cfebba0d63f1382c8ac59be081b6351681415f4063cf go1.12.5.linux-amd64.tar.gz<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">3. Similarly extract the tarball. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Subsequently use the tar command to extract the tarball to the \/usr\/local directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo tar -C \/usr\/local -xzf go1.12.5.linux-amd64.tar.gz<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">4. On the other hand adjust the Path Variable:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now we need to tell our system where to find the Go executable binaries by adjusting the <strong>PATH<\/strong> <strong>environment<\/strong> <strong>variable<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We can do this by appending the following line to the\u00a0<code>\/etc\/profile<\/code>\u00a0file (for a system-wide installation) or to the\u00a0<code>$HOME\/.bash_profile<\/code>\u00a0file (for a current user installation):<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">                             ~\/.bash_profile\n\nexport PATH=$PATH:\/usr\/local\/go\/bin<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save the file and load the new PATH environment variable into the current shell session with the following command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">source ~\/.bash_profile<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now, we have successfully downloaded and installed Go your CentOS system, you can start developing your Go projects.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thanks for using&nbsp;<a href=\"https:\/\/pheonixsolutions.com\/\">pheonix solutions<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You find this tutorial helpful? Share with your friends to keep it alive.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Install Go on CentOS &#8211; 7 Date Posted: 15\/05\/2019 Introduction Go, often referred to as golang is a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[161,650,261],"class_list":["post-4604","post","type-post","status-publish","format-standard","hentry","category-web-architecture","tag-centos","tag-go-install","tag-linux","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-1cg","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4604","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=4604"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4604\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=4604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=4604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=4604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}