LinuxCommandLibrary

gcloud-components-update

Update installed Google Cloud SDK components

TLDR

Update all components to the latest version

$ gcloud components update
copy

Update all components to a specific version
$ gcloud components update --version=[1.2.3]
copy

Update components without confirmation (useful for automation scripts)
$ gcloud components update --quiet
copy

SYNOPSIS

gcloud components update [COMPONENT...] [--allow-unsafe-upgrades] [--version=VERSION] [--version-check-interval=INTERVAL] [GLOBAL-FLAGS]

PARAMETERS

--allow-unsafe-upgrades
    Permit updates to pre-release or unstable versions.
Default: false.

--version=VERSION
    Pin update to a specific version string (e.g., '456.0.0').

--version-check-interval=INTERVAL
    Set update check frequency (duration like '1h', '1d').
Default: 1h.

--configuration=CONFIGURATION
    Use specified gcloud configuration (global flag).

--help
    Display detailed help (global flag).

--verbosity=VERBOSITY
    Set output verbosity: 'debug', 'info', 'warning', 'error', 'critical' (global flag).

COMPONENT...
    Optional list of specific components to update (e.g., 'kubectl', 'bq').

DESCRIPTION

The gcloud components update command refreshes the Google Cloud CLI (formerly SDK) and all its installed components to the latest stable versions available from Google's repositories.

It checks for updates across core tools like gcloud, kubectl, dq, gsutil, and others, downloading and installing new releases as needed. Components without updates are noted as current.

This ensures access to the newest features, bug fixes, security patches, and compatibility improvements. By default, it targets stable releases only, skipping pre-releases unless specified. Updates may require administrative privileges if the installation is system-wide.

Run it regularly (e.g., weekly) or integrate into scripts for automated maintenance. It respects the active configuration and logs progress, including any skipped or failed updates.

Version checking occurs periodically based on the interval setting, balancing update notifications with performance.

CAVEATS

Requires internet access and may prompt for sudo if not user-installed.
Backups not automatic; test post-update.
Large installs can take time and disk space.

EXAMPLES

Update all: gcloud components update
Specific component: gcloud components update kubectl bq
Pre-release: gcloud components update --allow-unsafe-upgrades

EXIT CODES

0: Success.
1: Update failed or interrupted.
2: Invalid arguments.

HISTORY

Introduced with Google Cloud SDK v100+ (2015), evolved alongside gcloud CLI rebranding (2021). Tracks Cloud SDK releases, with automated updates since v220+. Usage surged with Kubernetes/GKE adoption.

SEE ALSO

gcloud components install(1), gcloud components list(1), gcloud components remove(1)

Copied to clipboard