`apt-get install google-cloud-sdk` stopped working

Hello. We have a Dockerfile based on Debian v12 ("bookworm"), which sets up a Python application, which uses various Python client libraries to interact with GCP.

Until today, the Dockerfile was doing:

 

RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg \
    && echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list \
    && apt-get update -y \
    && apt-get install google-cloud-sdk -y

 

to install the google-cloud-sdk package.
Now when I try to build that container, I get an error,
google-cloud-cli : Breaks: google-cloud-sdk but 463.0.0-0 is to be installed
The version there, 463.x, is not listed yet in the releases, where the latest (as of 2024-02-06) is `462.0.1 (2024-01-31)`.
If I try to install that version instead, 

 

apt-get install google-cloud-sdk=462.0.1

 

it says ,
Package google-cloud-sdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
google-cloud-cli
It seems to me, reading between the lines of various docsStackOverflow, and Reddit, that `google-cloud-sdk` has been deprecated, and replaced with `google-cloud-cli`. (Though I can't find that transition explicitly documented anywhere in the GCP docs.)
 
However, if I simply install `google-cloud-cli` as a replacement for `google-cloud-sdk`, that does work to build the image, but then my application's Python clients no longer work. (This application is using Apache Airflow 2.8.0, if that's relevant. The errors are coming from Airflow's GCP wrapper around the `google-cloud-*` packages.)
 
Are the Python clients supposed to work with `google-cloud-cli` (rather than `sdk`) installed in the environment? Is there a document somewhere describing this transition, and any other steps needed to make this work?
 
Thank you in advance for any help.
7 1 810
1 REPLY 1

Hi @thebuckst0p,

Welcome to Google Cloud Community!

You are correct in your understanding of the situation. The google-cloud-sdk package has indeed been deprecated and replaced with google-cloud-cli. While the transition documentation might not be explicitly stated in one place, here's what's happening and how to handle it:

  • google-cloud-sdk is deprecated, replaced by google-cloud-cli for command-line tools and individual client libraries.
  • google-cloud-cli offers modularity and flexibility.
  • Python client libraries are still compatible with google-cloud-cli.
  • Adjust import statements and access methods if your application isn't working smoothly.
  • Check client library documentation for compatibility updates or usage changes.

Resources: