Answers: <p>It was fixed by installing the <code>google-cloud-cli</code> package instead of <code>gcloud-cloud-sdk</code>... Even though my understanding is it's meant to be an alias so I don't see why it's been broken now (as it's a breaking change too).</p>
  <p>Another alternative provided by another user in the issue tracker:</p>
  <p><code>apt-get install google-cloud-sdk=462.0.0-0 -y</code></p>
  <p><a href="https://issuetracker.google.com/u/1/issues/324027367" rel="nofollow noreferrer">https://issuetracker.google.com/u/1/issues/324027367</a></p>
  
Answers: CC BY-SA 4.0
Answers: 2024-02-06T17:53:55.280Z
Answers: 2024-02-06T17:53:55.280Z
Answers: Chris Stryczynski
Body: <pre><code>FROM debian:buster-slim
  
  
  RUN apt-get update &amp;&amp; apt-get install -y cron vim wget git zip unzip curl
  RUN apt-get update &amp;&amp; apt-get install -y gpg
  
  RUN echo &quot;deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main&quot; | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list \
    &amp;&amp; curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg \
    &amp;&amp; apt-get update -y \
    &amp;&amp; apt-get install google-cloud-sdk -y
  
  </code></pre>
  <p>Fails with:</p>
  <pre><code>Step 4/4 : RUN echo &quot;deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main&quot; | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list   &amp;&amp; curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg   &amp;&amp; apt-get update -y   &amp;&amp; apt-get install google-cloud-sdk -y
   ---&gt; Running in aa4bb6ccd2f9
  deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
  100  2659  100  2659    0     0  83093      0 --:--:-- --:--:-- --:--:-- 83093
  Hit:1 http://deb.debian.org/debian buster InRelease
  Hit:2 http://deb.debian.org/debian-security buster/updates InRelease
  Hit:3 http://deb.debian.org/debian buster-updates InRelease
  Get:4 http://packages.cloud.google.com/apt cloud-sdk InRelease [6361 B]
  Get:5 http://packages.cloud.google.com/apt cloud-sdk/main amd64 Packages [599 kB]
  Fetched 606 kB in 1s (1129 kB/s)
  Reading package lists...
  Reading package lists...
  Building dependency tree...
  Reading state information...
  Some packages could not be installed. This may mean that you have
  requested an impossible situation or if you are using the unstable
  distribution that some required packages have not yet been created
  or been moved out of Incoming.
  The following information may help to resolve the situation:
  
  The following packages have unmet dependencies:
   google-cloud-sdk : Depends: google-cloud-cli but it is not going to be installed
  E: Unable to correct problems, you have held broken packages.
  The command '/bin/sh -c echo &quot;deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main&quot; | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list   &amp;&amp; curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg   &amp;&amp; apt-get update -y   &amp;&amp; apt-get install google-cloud-sdk -y' returned a non-zero code: 100
  
  </code></pre>
  <p>Posting in case someone else stumbles upon this issue. It has been documented also by another person here: <a href="https://issuetracker.google.com/u/1/issues/324027367" rel="nofollow noreferrer">https://issuetracker.google.com/u/1/issues/324027367</a></p>
  
Tags: <google-cloud-platform><gcloud>
Title: gcloud sdk installation fails when it previously succeeded, did something externally break?
UserDisplayName: Chris Stryczynski
ThreadText: # gcloud sdk installation fails when it previously succeeded, did something externally break?
  
  (Asked by: username_0 on 2024-02-06)
  
  ```
  FROM debian:buster-slim
  
  RUN apt-get update && apt-get install -y cron vim wget git zip unzip curl
  RUN apt-get update && apt-get install -y gpg
  
  RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list \
    && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg \
    && apt-get update -y \
    && apt-get install google-cloud-sdk -y
  
  ```
  
  Fails with:
  
  ```
  Step 4/4 : RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list   && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg   && apt-get update -y   && apt-get install google-cloud-sdk -y
   ---> Running in aa4bb6ccd2f9
  deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
  100  2659  100  2659    0     0  83093      0 --:--:-- --:--:-- --:--:-- 83093
  Hit:1 http://deb.debian.org/debian buster InRelease
  Hit:2 http://deb.debian.org/debian-security buster/updates InRelease
  Hit:3 http://deb.debian.org/debian buster-updates InRelease
  Get:4 http://packages.cloud.google.com/apt cloud-sdk InRelease [6361 B]
  Get:5 http://packages.cloud.google.com/apt cloud-sdk/main amd64 Packages [599 kB]
  Fetched 606 kB in 1s (1129 kB/s)
  Reading package lists...
  Reading package lists...
  Building dependency tree...
  Reading state information...
  Some packages could not be installed. This may mean that you have
  requested an impossible situation or if you are using the unstable
  distribution that some required packages have not yet been created
  or been moved out of Incoming.
  The following information may help to resolve the situation:
  
  The following packages have unmet dependencies:
   google-cloud-sdk : Depends: google-cloud-cli but it is not going to be installed
  E: Unable to correct problems, you have held broken packages.
  The command '/bin/sh -c echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list   && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg   && apt-get update -y   && apt-get install google-cloud-sdk -y' returned a non-zero code: 100
  
  ```
  
  Posting in case someone else stumbles upon this issue. It has been documented also by another person here: <https://issuetracker.google.com/u/1/issues/324027367>
  
  **Tags:** google-cloud-platform, gcloud
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2024-02-06. Score: 0
  
  It was fixed by installing the `google-cloud-cli` package instead of `gcloud-cloud-sdk`... Even though my understanding is it's meant to be an alias so I don't see why it's been broken now (as it's a breaking change too).
  
  Another alternative provided by another user in the issue tracker:
  
  `apt-get install google-cloud-sdk=462.0.0-0 -y`
  
  <https://issuetracker.google.com/u/1/issues/324027367>
  
  
  ---
  
  