0
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

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.