{"id":919,"date":"2023-06-21T06:12:06","date_gmt":"2023-06-21T06:12:06","guid":{"rendered":"https:\/\/randomadult.local\/?p=919"},"modified":"2023-06-21T07:13:53","modified_gmt":"2023-06-21T07:13:53","slug":"install-google-cloud-cli-on-debian-12","status":"publish","type":"post","link":"https:\/\/randomadult.local\/install-google-cloud-cli-on-debian-12\/","title":{"rendered":"Install Google Cloud CLI on Debian 12"},"content":{"rendered":"\n

If you’re anything like me, and you go for bleeding edge releases to see what they’re like, there can be some drawbacks. The biggest being there is close to no updated documentation when trying to install common packages. I decided to give Debian<\/a> 12 a try after not using Debian since version 3. I was told there have been some great updates and decided to give it a go. If you, like myself and many others, copy and paste commands from documentation without really reading it, this article is for you.<\/p>\n\n\n\n

With Debian 12 I’m using apt<\/code> instead of apt-get<\/code>. This is why all my commands differ from those found in the Google Cloud documentation. <\/a>The problem is the commands provided in the documentation don’t work. <\/p>\n\n\n\n

Install Google Cloud CLI<\/h2>\n\n\n\n

<\/p>\n\n\n\n

Prepare the installation <\/h3>\n\n\n
\nsudo apt update\nsudo apt install apt-transport-https ca-certificates gnupg curl\n<\/pre><\/div>\n\n\n

Add the package source<\/strong><\/p>\n\n\n

\nsudo echo "deb https:\/\/packages.cloud.google.com\/apt cloud-sdk main" | sudo tee -a \/etc\/apt\/sources.list.d\/google-cloud-sdk.list\n<\/pre><\/div>\n\n\n

Import the Google Cloud public key<\/h3>\n\n\n\n

The docs say to run the following command to add the Cloud SDK distribution URI as a package source, but gives you a warning due to deprecation.<\/p>\n\n\n

\ncurl https:\/\/packages.cloud.google.com\/apt\/doc\/apt-key.gpg | sudo tee \/usr\/share\/keyrings\/cloud.google.gpg \n<\/pre><\/div>\n\n\n

After some googling, I found that apt-key<\/code> has been deprecated in favour of managing keys in \/etc\/apt\/trustd.gpg.d <\/code>I thought I could just copy the GPG file into this directory. I was wrong<\/strong>. This will result in the following error. <\/p>\n\n\n

\nThe key(s) in the keyring \/etc\/apt\/trusted.gpg.d\/cloud.google.gpg are ignored as the file has an unsupported filetype.\n<\/pre><\/div>\n\n\n

We need to convert the GPG file to the correct format. To do that, we can use gpg --dearmor. <\/code>Let’s update the command so that it works correctly. <\/p>\n\n\n

\nsudo curl https:\/\/packages.cloud.google.com\/apt\/doc\/apt-key.gpg | gpg --dearmor | sudo tee \/etc\/apt\/trusted.gpg.d\/cloud.google.gpg\n<\/pre><\/div>\n\n\n

Update and install <\/h3>\n\n\n
\nsudo apt update && sudo apt install google-cloud-cli\n<\/pre><\/div>\n\n\n

Conclusion <\/h2>\n\n\n\n

This took me far too long to find the answers, as I haven’t been an apt or Debian user for many years. I hope this helps someone save a few minutes when they’re trying to get their shiny new Debian 12 installation working for the dev and dev-ops environment. <\/p>\n","protected":false},"excerpt":{"rendered":"

If you’re anything like me, and you go for bleeding edge releases to see what they’re like, there can be some drawbacks. The biggest being there is close to no updated documentation when trying to install common packages. I decided to give Debian 12 a try after not using Debian …<\/p>\n

Install Google Cloud CLI on Debian 12<\/span> Read More \u00bb<\/a><\/p>\n","protected":false},"author":1,"featured_media":925,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"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":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[5],"tags":[299,297,298,113],"yoast_head":"\nInstall Google Cloud CLI on Debian 12 - Random Adult<\/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:\/\/randomadult.local\/install-google-cloud-cli-on-debian-12\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Install Google Cloud CLI on Debian 12\" \/>\n<meta property=\"og:description\" content=\"If you’re anything like me, and you go for bleeding edge releases to see what they’re like, there can be some drawbacks. The biggest being there is close to no updated documentation when trying to install common packages. I decided to give Debian 12 a try after not using Debian … Install Google Cloud CLI on Debian 12 Read More \u00bb\" \/>\n<meta property=\"og:url\" content=\"https:\/\/randomadult.local\/install-google-cloud-cli-on-debian-12\/\" \/>\n<meta property=\"og:site_name\" content=\"Random Adult\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-21T06:12:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-21T07:13:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/randomadult.local\/wp-content\/uploads\/2023\/06\/nlsxfjl_nhc.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1600\" \/>\n\t<meta property=\"og:image:height\" content=\"1067\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"digitalchild\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dcwhatwhat\" \/>\n<meta name=\"twitter:site\" content=\"@dcwhatwhat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"digitalchild\" \/>\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:\/\/randomadult.local\/install-google-cloud-cli-on-debian-12\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/randomadult.local\/install-google-cloud-cli-on-debian-12\/\"},\"author\":{\"name\":\"digitalchild\",\"@id\":\"https:\/\/randomadult.local\/#\/schema\/person\/b0b954202434291ace51b4e7a0a81c04\"},\"headline\":\"Install Google Cloud CLI on Debian 12\",\"datePublished\":\"2023-06-21T06:12:06+00:00\",\"dateModified\":\"2023-06-21T07:13:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/randomadult.local\/install-google-cloud-cli-on-debian-12\/\"},\"wordCount\":293,\"publisher\":{\"@id\":\"https:\/\/randomadult.local\/#organization\"},\"keywords\":[\"cli\",\"debian\",\"google cloud\",\"linux\"],\"articleSection\":[\"Geek\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/randomadult.local\/install-google-cloud-cli-on-debian-12\/\",\"url\":\"https:\/\/randomadult.local\/install-google-cloud-cli-on-debian-12\/\",\"name\":\"Install Google Cloud CLI on Debian 12 - Random Adult\",\"isPartOf\":{\"@id\":\"https:\/\/randomadult.local\/#website\"},\"datePublished\":\"2023-06-21T06:12:06+00:00\",\"dateModified\":\"2023-06-21T07:13:53+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/randomadult.local\/install-google-cloud-cli-on-debian-12\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/randomadult.local\/install-google-cloud-cli-on-debian-12\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/randomadult.local\/install-google-cloud-cli-on-debian-12\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/randomadult.local\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Install Google Cloud CLI on Debian 12\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/randomadult.local\/#website\",\"url\":\"https:\/\/randomadult.local\/\",\"name\":\"Random Adult\",\"description\":\"Ramblings of a random adult\",\"publisher\":{\"@id\":\"https:\/\/randomadult.local\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/randomadult.local\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/randomadult.local\/#organization\",\"name\":\"Random Adult\",\"url\":\"https:\/\/randomadult.local\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/randomadult.local\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/randomadult.local\/wp-content\/uploads\/2020\/01\/logo.png\",\"contentUrl\":\"https:\/\/randomadult.local\/wp-content\/uploads\/2020\/01\/logo.png\",\"width\":320,\"height\":134,\"caption\":\"Random Adult\"},\"image\":{\"@id\":\"https:\/\/randomadult.local\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/twitter.com\/dcwhatwhat\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/randomadult.local\/#\/schema\/person\/b0b954202434291ace51b4e7a0a81c04\",\"name\":\"digitalchild\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/randomadult.local\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e0331079f6730910bc7760cb8f781237?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e0331079f6730910bc7760cb8f781237?s=96&d=mm&r=g\",\"caption\":\"digitalchild\"},\"url\":\"https:\/\/randomadult.local\/author\/digitalchild\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Install Google Cloud CLI on Debian 12 - Random Adult","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:\/\/randomadult.local\/install-google-cloud-cli-on-debian-12\/","og_locale":"en_US","og_type":"article","og_title":"Install Google Cloud CLI on Debian 12","og_description":"If you’re anything like me, and you go for bleeding edge releases to see what they’re like, there can be some drawbacks. The biggest being there is close to no updated documentation when trying to install common packages. I decided to give Debian 12 a try after not using Debian … Install Google Cloud CLI on Debian 12 Read More \u00bb","og_url":"https:\/\/randomadult.local\/install-google-cloud-cli-on-debian-12\/","og_site_name":"Random Adult","article_published_time":"2023-06-21T06:12:06+00:00","article_modified_time":"2023-06-21T07:13:53+00:00","og_image":[{"width":1600,"height":1067,"url":"https:\/\/randomadult.local\/wp-content\/uploads\/2023\/06\/nlsxfjl_nhc.jpg","type":"image\/jpeg"}],"author":"digitalchild","twitter_card":"summary_large_image","twitter_creator":"@dcwhatwhat","twitter_site":"@dcwhatwhat","twitter_misc":{"Written by":"digitalchild","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/randomadult.local\/install-google-cloud-cli-on-debian-12\/#article","isPartOf":{"@id":"https:\/\/randomadult.local\/install-google-cloud-cli-on-debian-12\/"},"author":{"name":"digitalchild","@id":"https:\/\/randomadult.local\/#\/schema\/person\/b0b954202434291ace51b4e7a0a81c04"},"headline":"Install Google Cloud CLI on Debian 12","datePublished":"2023-06-21T06:12:06+00:00","dateModified":"2023-06-21T07:13:53+00:00","mainEntityOfPage":{"@id":"https:\/\/randomadult.local\/install-google-cloud-cli-on-debian-12\/"},"wordCount":293,"publisher":{"@id":"https:\/\/randomadult.local\/#organization"},"keywords":["cli","debian","google cloud","linux"],"articleSection":["Geek"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/randomadult.local\/install-google-cloud-cli-on-debian-12\/","url":"https:\/\/randomadult.local\/install-google-cloud-cli-on-debian-12\/","name":"Install Google Cloud CLI on Debian 12 - Random Adult","isPartOf":{"@id":"https:\/\/randomadult.local\/#website"},"datePublished":"2023-06-21T06:12:06+00:00","dateModified":"2023-06-21T07:13:53+00:00","breadcrumb":{"@id":"https:\/\/randomadult.local\/install-google-cloud-cli-on-debian-12\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/randomadult.local\/install-google-cloud-cli-on-debian-12\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/randomadult.local\/install-google-cloud-cli-on-debian-12\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/randomadult.local\/"},{"@type":"ListItem","position":2,"name":"Install Google Cloud CLI on Debian 12"}]},{"@type":"WebSite","@id":"https:\/\/randomadult.local\/#website","url":"https:\/\/randomadult.local\/","name":"Random Adult","description":"Ramblings of a random adult","publisher":{"@id":"https:\/\/randomadult.local\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/randomadult.local\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/randomadult.local\/#organization","name":"Random Adult","url":"https:\/\/randomadult.local\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/randomadult.local\/#\/schema\/logo\/image\/","url":"https:\/\/randomadult.local\/wp-content\/uploads\/2020\/01\/logo.png","contentUrl":"https:\/\/randomadult.local\/wp-content\/uploads\/2020\/01\/logo.png","width":320,"height":134,"caption":"Random Adult"},"image":{"@id":"https:\/\/randomadult.local\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/twitter.com\/dcwhatwhat"]},{"@type":"Person","@id":"https:\/\/randomadult.local\/#\/schema\/person\/b0b954202434291ace51b4e7a0a81c04","name":"digitalchild","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/randomadult.local\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e0331079f6730910bc7760cb8f781237?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e0331079f6730910bc7760cb8f781237?s=96&d=mm&r=g","caption":"digitalchild"},"url":"https:\/\/randomadult.local\/author\/digitalchild\/"}]}},"_links":{"self":[{"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/posts\/919"}],"collection":[{"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/comments?post=919"}],"version-history":[{"count":8,"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/posts\/919\/revisions"}],"predecessor-version":[{"id":937,"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/posts\/919\/revisions\/937"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/media\/925"}],"wp:attachment":[{"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/media?parent=919"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/categories?post=919"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/tags?post=919"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}