{"id":7374,"date":"2021-06-22T16:35:32","date_gmt":"2021-06-22T16:35:32","guid":{"rendered":"https:\/\/linuxways.net\/?p=7374"},"modified":"2021-06-22T16:35:32","modified_gmt":"2021-06-22T16:35:32","slug":"how-to-install-google-cloud-sdk-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/how-to-install-google-cloud-sdk-on-ubuntu-20-04\/","title":{"rendered":"How to Install Google Cloud SDK on Ubuntu 20.04"},"content":{"rendered":"<p>Google provides a set of tools and utilities to help users manage resources hosted on GCP (Google Cloud Platform ). This set of tools is collectively referred to as Google Cloud SDK, short for Software Development Kit. The Google Cloud SDK comprises gcloud, gsutil, and bqcommand line utilities.<\/p>\n<p>In this guide, we examine different ways of installing Google Cloud SDK on Ubuntu 20.04. You can install Google Cloud SDK from the official Ubuntu APT repository or using Snap packages. Let\u2019s explore each of these installation modes.<\/p>\n<h2><strong>Install Google SDK from Ubuntu repository<\/strong><\/h2>\n<p>Google Provides an official repository from which you can install the Google SDK on your system. Ideally, this is what you would consider since it provides the latest SDK packages from the official repository.<\/p>\n<p>But first, make a point of updating your package lists as shown.<\/p>\n<pre><strong>$ sudo apt update<\/strong><\/pre>\n<pre><strong>$ sudo apt install curl apt-transport-https ca-certificates gnupg<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"793\" height=\"414\" class=\"wp-image-7375\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-549.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-549.png 793w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-549-300x157.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-549-768x401.png 768w\" sizes=\"auto, (max-width: 793px) 100vw, 793px\" \/><\/p>\n<p>Next, create the Google SDK repository file as shown:<\/p>\n<pre><strong>$ sudo vim \/etc\/apt\/sources.list.d\/google-cloud-sdk.list<\/strong><\/pre>\n<p>And add the line below:<\/p>\n<pre><strong>deb [signed-by=\/usr\/share\/keyrings\/cloud.google.gpg] https:\/\/packages.cloud.google.com\/apt cloud-sdk main<\/strong><\/pre>\n<p>With the repository added, download the public key for Google Cloud as shown.<\/p>\n<pre><strong>$ curl https:\/\/packages.cloud.google.com\/apt\/doc\/apt-key.gpg | sudo apt-key --keyring \/usr\/share\/keyrings\/cloud.google.gpg add -<\/strong><\/pre>\n<p>Then sync the newly added repository with Google repositories by updating the package index.<\/p>\n<pre><strong>$ sudo apt update<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"791\" height=\"355\" class=\"wp-image-7376\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-550.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-550.png 791w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-550-300x135.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-550-768x345.png 768w\" sizes=\"auto, (max-width: 791px) 100vw, 791px\" \/><\/strong><\/p>\n<p>Lastly, install the Google SDK from the Ubuntu repository as follows:<\/p>\n<pre><strong>$ sudo apt install google-cloud-sdk<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"791\" height=\"414\" class=\"wp-image-7377\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-551.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-551.png 791w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-551-300x157.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-551-768x402.png 768w\" sizes=\"auto, (max-width: 791px) 100vw, 791px\" \/><\/strong><\/p>\n<p>Type \u2018Y\u2019 to continue with the installation of Google SDK packages and dependencies.<\/p>\n<h2><strong>Install Google SDK using Snap packages<\/strong><\/h2>\n<p>A shorter and easier way of accomplishing all this is by using snap packages. By default, snap is enabled on Ubuntu 18.04 and later versions.<\/p>\n<p>Thus, you can install the SDK using a single command as shown.<\/p>\n<pre><strong>$ sudo snap install google-cloud-sdk --classic<\/strong><\/pre>\n<p>This takes a bit of time since snap packages are quite bulky in size.<\/p>\n<h2><strong>Initializing Google SDK<\/strong><\/h2>\n<p>After the installation, of which any of the two methods should work, the only thing remaining is to initialize it. To do so, execute the command:<\/p>\n<pre><strong>$ sudo gcloud init<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"796\" height=\"324\" class=\"wp-image-7378\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-552.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-552.png 796w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-552-300x122.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-552-768x313.png 768w\" sizes=\"auto, (max-width: 796px) 100vw, 796px\" \/><\/p>\n<p>The command provides you to continue. Simply press <strong>\u2018Y<\/strong>\u2019 to proceed. A link to log in to your Google account will be provided as shown. You can click on it directly or copy and paste it on a browser.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"794\" height=\"245\" class=\"wp-image-7379\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-553.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-553.png 794w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-553-300x93.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-553-768x237.png 768w\" sizes=\"auto, (max-width: 794px) 100vw, 794px\" \/><\/p>\n<p>At this point, provide your login credentials to your Google account.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"830\" height=\"608\" class=\"wp-image-7380\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-554.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-554.png 830w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-554-300x220.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-554-768x563.png 768w\" sizes=\"auto, (max-width: 830px) 100vw, 830px\" \/><\/p>\n<p>And that brings this guide to a close. We have successfully installed and setup Google Cloud SDK on Ubuntu 20.04.<\/p>","protected":false},"excerpt":{"rendered":"<p>Google provides a set of tools and utilities to help users manage resources hosted on GCP (Google Cloud Platform ). This set of tools is collectively referred to&hellip;<\/p>","protected":false},"author":1,"featured_media":7558,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[377,100],"class_list":["post-7374","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-google-cloud-sdk","tag-ubuntu-20-04"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/7374","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=7374"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/7374\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/7558"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=7374"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=7374"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=7374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}