{"id":1030,"date":"2023-11-23T12:07:56","date_gmt":"2023-11-23T11:07:56","guid":{"rendered":"https:\/\/simon-frey.com\/blog\/?p=1030"},"modified":"2024-03-22T10:43:17","modified_gmt":"2024-03-22T09:43:17","slug":"how-to-install-golang-go-1-21-in-ubuntu-with-snap","status":"publish","type":"post","link":"https:\/\/simon-frey.com\/blog\/how-to-install-golang-go-1-21-in-ubuntu-with-snap\/","title":{"rendered":"How to install golang (go) >1.21 in Ubuntu with Snap"},"content":{"rendered":"\n<p>Install golang in a somewhat recent version in Ubuntu is quite annoying. Here a on-line command which will do the trick for you. (Replace 1.21 with whatever version of go you want to install)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt remove --autoremove golang-go; sudo apt install snapd; sudo snap install --classic --channel=1.21\/stable go<\/code><\/pre>\n\n\n\n<p>What it does: <\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><code>sudo apt remove --autoremove golang-go<\/code> Remove all current go installation you installed via apt<\/li><li><code>sudo apt install snapd;<\/code> Install snap (Software packaging system by Canonical &lt;= Folks behind ubuntu. <a href=\"https:\/\/en.wikipedia.org\/wiki\/Snap_(software)\" target=\"_blank\" rel=\"noreferrer noopener\">Learn more<\/a>)<\/li><li><code>sudo snap install --classic --channel=1.21\/stable go<\/code> Use snap to install golang<\/li><\/ol>\n\n\n\n<p>This works like a charm, and after hours of trying to make it work via the binary download &#8220;official&#8221; way mentioned on the golang.org this finally made my golang installation work. <\/p>\n\n\n<div class=\"lazyblock-ad-banKB wp-block-lazyblock-ad\"><div style=\"display:block;font-family:sans-serif; border:2px solid #00000020;padding: 0.5em;margin-top:1em;margin-bottom:1em;\">\n  <div style=\"display:flex;justify-content:center;align-items:center;gap:10px;\">\n  <div style=\"line-height: 1.3em;text-align:left;\"><h3>Highly skilled DevOps\/SRE Freelancer<\/h3>\n  <p>I am Simon, the author of this blog. And I have great news: <b style=\"font-weight:bold;\">You can work with me<\/b><\/p>\n  <p>As DevOps and Infrastructure freelancer, I will help you choose the right Infrastructure technology for your company, fix your cloud problems and support your team in building scalable products.<\/p>\n  <p>I work with Golang, Docker, Kubernetes, Google Cloud, AWS and Terraform.<\/p>\n  <p>Checkout my <a href=\"https:\/\/simon-frey.com\/cv\" target=\"_blank\">CV<\/a> to learn more or directly contact me via the button below.<\/p>\n  <\/div>  \n  <img decoding=\"async\" data-src=\"https:\/\/simon-frey.com\/cv\/img\/simon-frey.jpg\" alt=\"Simon Frey Header image\" style=\"height:10em;\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\">\n\n  <\/div>\n  \n  <a href=\"mailto:contact@simon-frey.com\" style=\"display:block;text-align:center;color:black;text-decoration:none;border:solid 2px black;padding:10px;border-radius:5px;margin-top:1em;\">Let&#8217;s work together!<\/a>\n<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Install golang in a somewhat recent version in Ubuntu is quite annoying. Here a on-line command which will do the trick for you. (Replace 1.21 with whatever version of go you want to install) What&hellip;<\/p>\n<p><a href=\"https:\/\/simon-frey.com\/blog\/how-to-install-golang-go-1-21-in-ubuntu-with-snap\/\" class=\"more-link\">Read more<span class=\"screen-reader-text\"> of How to install golang (go) &gt;1.21 in Ubuntu with Snap<\/span><span aria-hidden=\"true\"> &rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":1044,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[232],"tags":[],"class_list":["post-1030","post","type-post","status-publish","format-standard","hentry","category-devops"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to install golang (go) &gt;1.21 in Ubuntu with Snap - Blog by Simon Frey<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/simon-frey.com\/blog\/how-to-install-golang-go-1-21-in-ubuntu-with-snap\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Simon Frey\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to install golang (go) >1.21 in Ubuntu with Snap - Blog by Simon Frey","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:\/\/simon-frey.com\/blog\/how-to-install-golang-go-1-21-in-ubuntu-with-snap\/","twitter_misc":{"Written by":"Simon Frey","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/simon-frey.com\/blog\/how-to-install-golang-go-1-21-in-ubuntu-with-snap\/#article","isPartOf":{"@id":"https:\/\/simon-frey.com\/blog\/how-to-install-golang-go-1-21-in-ubuntu-with-snap\/"},"author":{"name":"Simon Frey","@id":"https:\/\/simon-frey.com\/blog\/#\/schema\/person\/34753982b648415636ee7a079f3e19a3"},"headline":"How to install golang (go) >1.21 in Ubuntu with Snap","datePublished":"2023-11-23T11:07:56+00:00","dateModified":"2024-03-22T09:43:17+00:00","mainEntityOfPage":{"@id":"https:\/\/simon-frey.com\/blog\/how-to-install-golang-go-1-21-in-ubuntu-with-snap\/"},"wordCount":104,"publisher":{"@id":"https:\/\/simon-frey.com\/blog\/#\/schema\/person\/34753982b648415636ee7a079f3e19a3"},"image":{"@id":"https:\/\/simon-frey.com\/blog\/how-to-install-golang-go-1-21-in-ubuntu-with-snap\/#primaryimage"},"thumbnailUrl":"https:\/\/simon-frey.com\/blog\/wp-content\/uploads\/2023\/11\/how-to-install-golang-go-1-21-in-ubuntu-with-snap-1700738379.png","articleSection":["DevOps"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/simon-frey.com\/blog\/how-to-install-golang-go-1-21-in-ubuntu-with-snap\/","url":"https:\/\/simon-frey.com\/blog\/how-to-install-golang-go-1-21-in-ubuntu-with-snap\/","name":"How to install golang (go) >1.21 in Ubuntu with Snap - Blog by Simon Frey","isPartOf":{"@id":"https:\/\/simon-frey.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/simon-frey.com\/blog\/how-to-install-golang-go-1-21-in-ubuntu-with-snap\/#primaryimage"},"image":{"@id":"https:\/\/simon-frey.com\/blog\/how-to-install-golang-go-1-21-in-ubuntu-with-snap\/#primaryimage"},"thumbnailUrl":"https:\/\/simon-frey.com\/blog\/wp-content\/uploads\/2023\/11\/how-to-install-golang-go-1-21-in-ubuntu-with-snap-1700738379.png","datePublished":"2023-11-23T11:07:56+00:00","dateModified":"2024-03-22T09:43:17+00:00","breadcrumb":{"@id":"https:\/\/simon-frey.com\/blog\/how-to-install-golang-go-1-21-in-ubuntu-with-snap\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/simon-frey.com\/blog\/how-to-install-golang-go-1-21-in-ubuntu-with-snap\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/simon-frey.com\/blog\/how-to-install-golang-go-1-21-in-ubuntu-with-snap\/#primaryimage","url":"https:\/\/simon-frey.com\/blog\/wp-content\/uploads\/2023\/11\/how-to-install-golang-go-1-21-in-ubuntu-with-snap-1700738379.png","contentUrl":"https:\/\/simon-frey.com\/blog\/wp-content\/uploads\/2023\/11\/how-to-install-golang-go-1-21-in-ubuntu-with-snap-1700738379.png","width":1200,"height":630,"caption":"How to install golang (go) >1.21 in Ubuntu with Snap"},{"@type":"BreadcrumbList","@id":"https:\/\/simon-frey.com\/blog\/how-to-install-golang-go-1-21-in-ubuntu-with-snap\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/simon-frey.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to install golang (go) >1.21 in Ubuntu with Snap"}]},{"@type":"WebSite","@id":"https:\/\/simon-frey.com\/blog\/#website","url":"https:\/\/simon-frey.com\/blog\/","name":"Blog by Simon Frey","description":"","publisher":{"@id":"https:\/\/simon-frey.com\/blog\/#\/schema\/person\/34753982b648415636ee7a079f3e19a3"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/simon-frey.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/simon-frey.com\/blog\/#\/schema\/person\/34753982b648415636ee7a079f3e19a3","name":"Simon Frey","logo":{"@id":"https:\/\/simon-frey.com\/blog\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/simon-frey.com","https:\/\/www.linkedin.com\/in\/simonfrey\/","https:\/\/x.com\/eu_frey"]}]}},"_links":{"self":[{"href":"https:\/\/simon-frey.com\/blog\/wp-json\/wp\/v2\/posts\/1030","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/simon-frey.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/simon-frey.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/simon-frey.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/simon-frey.com\/blog\/wp-json\/wp\/v2\/comments?post=1030"}],"version-history":[{"count":6,"href":"https:\/\/simon-frey.com\/blog\/wp-json\/wp\/v2\/posts\/1030\/revisions"}],"predecessor-version":[{"id":1130,"href":"https:\/\/simon-frey.com\/blog\/wp-json\/wp\/v2\/posts\/1030\/revisions\/1130"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/simon-frey.com\/blog\/wp-json\/wp\/v2\/media\/1044"}],"wp:attachment":[{"href":"https:\/\/simon-frey.com\/blog\/wp-json\/wp\/v2\/media?parent=1030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/simon-frey.com\/blog\/wp-json\/wp\/v2\/categories?post=1030"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/simon-frey.com\/blog\/wp-json\/wp\/v2\/tags?post=1030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}