Installing the Datastore Emulator from the Ubuntu Package Repository
You have a developer laptop with the Cloud SDK installed on Ubuntu. The Cloud SDK was installed from the Google Cloud Ubuntu package repository. You want to test your application locally on your laptop with Cloud Datastore. What should you do?
Community Insight
This question tests whether you know that an apt-installed Cloud SDK disables the gcloud components manager, so the common trap is reflexively running 'gcloud components install cloud-datastore-emulator', which fails on this installation type.
When the Google Cloud SDK is installed on Ubuntu from the official apt repository, the built-in Component Manager is disabled, so extras such as the Cloud Datastore emulator must be added through apt. The page confirms that the correct action is installing the google-cloud-sdk-datastore-emulator package with apt-get, enabling local Datastore testing on the developer laptop.
Option D (gcloud components install cloud-datastore-emulator) is the popular wrong pick: it is the standard command for tarball or bundled installs, but on an apt-based install gcloud returns an error stating the component manager is disabled and tells you to use the package manager instead.
Community Discussion (163 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
The question explicitly states the Cloud SDK on Ubuntu came from the Google Cloud Ubuntu package repository (installed via apt). Google's own documentation notes that instructions involving the component manager "will not work if you have installed Cloud SDK using a package manager such as APT or yum because Cloud SDK Component Manager is disabled." For that install type, optional components are delivered as separate Debian packages, and the Datastore emulator is the package google-cloud-sdk-datastore-emulator, installed withsudo apt-get install google-cloud-sdk-datastore-emulator. That matches option C exactly and gives the developer a locally runnable emulator for testing the application against Datastore.Why the Other Options Are Wrong
Option D,gcloud components install cloud-datastore-emulator, is the correct procedure only for installations that manage themselves (zip/tarball, bundled, or installer-based); on an apt-based install it raises an error saying the component manager is disabled, so it cannot accomplish the goal here. Option A, gcloud datastore export, exports production Cloud Datastore data to Cloud Storage — it neither installs an emulator nor supports local testing, and it requires a running Datastore instance. Option B, gcloud datastore indexes create, only creates a composite index in a live Datastore database and is unrelated to setting up a local development environment.Community Comment Notes
The community converges strongly on C. XRiddlerX reproduces the failure of the D route, noting the error "You cannot perform this action because the Cloud SDK component manager is disabled for this installation" and quoting the apt-based alternative. SWObaby captures the trap well, observing that the question's phrase about the Ubuntu package repository is decisive and that D "seems like an attractive answer" but "does NOT fit the context of the question." Eshkrkrkr cites the official components doc warning that the component-manager steps fail for APT or yum installs, and ShakthiGCP reports having verified the answer on a fresh Ubuntu server. Only one voice, professor, argued for D by pointing at the emulator documentation page, but that page'sgcloud components install route does not apply to the installation method stated in the question. Official Reference
Exam Strategy
Read the installation method as the deciding constraint — whenever a question mentions apt, yum, or a package repository, assume the gcloud component manager is disabled and reach for the package manager. Cross-check each option against the stated environment rather than against what is merely a valid command elsewhere.
Frequently Asked Questions
Why doesn't 'gcloud components install cloud-datastore-emulator' work on my Ubuntu laptop?
Because the Cloud SDK installed from the Google Cloud Ubuntu apt repository has its Component Manager disabled. gcloud returns an error telling you to install optional components through the package manager instead.
What package do I install with apt-get to test Cloud Datastore locally?
Use sudo apt-get install google-cloud-sdk-datastore-emulator. It adds the Datastore emulator component, which you then start with the gcloud beta emulators datastore start command for local testing.
Related Analysis
Practice All ACE Questions
Access 84 questions with complete answers and detailed explanations.
View Full ACE Practice Test →