Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
In Compute Engine können Sie die Betriebssysteme, die auf Ihren virtuellen Maschinen (VMs) ausgeführt werden, mithilfe von VM Manager verwalten.
Auf dieser Seite wird beschrieben, wie Sie ein vorhandenes Setup von VM Manager aktualisieren.
Google empfiehlt die Verwendung der neuesten Version des Agents.
Hinweise
Richten Sie die Authentifizierung ein, falls Sie dies noch nicht getan haben.
Bei der Authentifizierung wird Ihre Identität für den Zugriff auf Google Cloud -Dienste und APIs überprüft. Zum Ausführen von Code oder Beispielen aus einer lokalen Entwicklungsumgebung können Sie sich so bei Compute Engine authentifizieren:
Installieren Sie die Google Cloud CLI.
Initialisieren Sie die Google Cloud CLI nach der Installation mit dem folgenden Befehl:
Führen Sie den folgenden Befehl aus, um den Agent in SLES zu aktualisieren:
sudo zypper -n update google-osconfig-agent
Um den Agent auf SLES-VMs zu aktualisieren, können Sie den Agent auch mithilfe der von Google bereitgestellten Pakete neu installieren. Informationen zur Installation mit von Google bereitgestellten Paketen finden Sie unter OS Config-Agent installieren.
Ubuntu
Führen Sie die folgenden Befehle aus, um den Agent auf Ubuntu-Betriebssystemen zu aktualisieren:
Zum Aktualisieren des Agents auf Ubuntu-VMs empfehlen wir, eine Neuinstallation des Agents mit den von Google bereitgestellten Paketen durchzuführen. Informationen zur Installation mit von Google bereitgestellten Paketen finden Sie unter OS Config-Agent installieren.
Windows
Führen Sie den folgenden Befehl aus, um den Agent unter Windows-Betriebssystemen zu aktualisieren:
googet install google-osconfig-agent
Patch-Job ausführen
Eine andere Methode zur Aktualisierung des OS Config-Agents besteht darin, einen Patch-Job auszuführen und dabei das Flag exclusive_packages anzugeben. Mit diesem Patch-Job wird der OS Config-Agent nur auf den Ziel-VMs aktualisiert.
Zum Festlegen der Ziel-VMs müssen Sie einen INSTANCE_FILTER angeben.
Weitere Informationen dazu finden Sie unter Instanzfilter.
CentOS/RHEL/Rocky
Führen Sie die folgenden Befehle aus, um den Agent auf CentOS-, Rocky Linux- und RHEL-VMs zu aktualisieren:
Um den Agent auf SLES-VMs zu aktualisieren, können Sie den Agent auch mithilfe der von Google bereitgestellten Pakete neu installieren. Informationen zur Installation mit von Google bereitgestellten Paketen finden Sie unter OS Config-Agent installieren.
Ubuntu
Führen Sie die folgenden Befehle aus, um den Agent für Ubuntu-VMs zu aktualisieren:
Zum Aktualisieren des Agents auf Ubuntu-VMs empfehlen wir, eine Neuinstallation des Agents mit den von Google bereitgestellten Paketen durchzuführen. Informationen zur Installation mit von Google bereitgestellten Paketen finden Sie unter OS Config-Agent installieren.
Windows
Um den Agent für Windows-VMs zu aktualisieren, führen Sie folgenden Befehl aus:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[[["\u003cp\u003eThis page details how to upgrade an existing VM Manager setup, which Google recommends keeping up-to-date for optimal performance.\u003c/p\u003e\n"],["\u003cp\u003eTo update the VM Manager, users must first check the current OS Config agent version installed on their VMs.\u003c/p\u003e\n"],["\u003cp\u003eThe OS Config agent can be updated either by updating the operating system's package directly or by running a patch job.\u003c/p\u003e\n"],["\u003cp\u003eSpecific commands for updating the OS Config agent are provided for CentOS, RHEL, Rocky Linux, Debian, SLES, Ubuntu, and Windows operating systems.\u003c/p\u003e\n"],["\u003cp\u003eCertain OS systems such as SLES and Ubuntu may require a reinstall of the agent using the Google provided packages to have the latest version.\u003c/p\u003e\n"]]],[],null,["# Update VM Manager\n\nOn Compute Engine you can manage the operating systems that are running on\nyour virtual machines (VMs) by using\n[VM Manager](/compute/vm-manager/docs).\n\nThis page describes how to upgrade\n[an existing setup of VM Manager](/compute/vm-manager/docs/setup).\nGoogle recommends that you use the latest version of the agent.\n\nBefore you begin\n----------------\n\n- If you haven't already, set up [authentication](/compute/docs/authentication). Authentication verifies your identity for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:\n 1.\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n After installation,\n [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command:\n\n ```bash\n gcloud init\n ```\n\n\n If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n | **Note:** If you installed the gcloud CLI previously, make sure you have the latest version by running `gcloud components update`.\n 2. [Set a default region and zone](/compute/docs/gcloud-compute#set_default_zone_and_region_in_your_local_client).\n\nOverview\n--------\n\nTo update your VM Manager setup, complete the following steps:\n\n1. [Check the current version](#view-version) of the OS Config agent that is installed on your VMs. For more information about the OS Config agent versions, see the [GoogleCloudPlatform/osconfig](https://github.com/GoogleCloudPlatform/osconfig/tags) GitHub repository.\n - To use OS inventory management, your VM must be running an OS Config agent version dated `20201110` or later\n - To use OS policies, your VM must be running an OS Config agent version dated `20210427` or later.\n2. If the version of your OS config agent does not support the new features, [update the OS Config agent](#update-agent).\n\nView OS Config agent version\n----------------------------\n\nIf you have [OS inventory management (earlier version)](/compute/vm-manager/docs/os-inventory/view-os-details#version-one)\nrunning on your VMs, you can check the OS Config agent version by running\nthe following command: \n\n```\ngcloud compute instances os-inventory describe VM-NAME \\\n --zone=ZONE\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eVM-NAME\u003c/var\u003e: the name of your VM\n- \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: the zone where the VM is located\n\nIn the output, search for `OSConfigAgentVersion`. \n\n```\nOSConfigAgentVersion: 20210316.00-g1\n```\n\nIn the preceding output snippet, the OS Config agent version is dated `20210316`\n(2021-03-16).\n\nUpdate the OS Config agent\n--------------------------\n\nTo update the OS Config agent, do one of the following:\n\n- [Update the package](#os-package) for your operating system\n- [Run a patch job](#patch-job)\n\n### Update OS packages\n\nOne method of updating the OS Config agent is to update the package for your\noperating system. \n\n### CentOS/RHEL/Rocky\n\nTo update the agent on CentOS, Rocky Linux, and RHEL operating systems, run\nthe following command: \n\n```\nsudo yum update google-osconfig-agent\n```\n\n### Debian\n\nTo update the agent on Debian operating systems, run the\nfollowing commands: \n\n```\nsudo apt update\nsudo apt install google-osconfig-agent\n```\n\n### SLES\n\nTo update the agent on SLES, run the following command: \n\n```\nsudo zypper -n update google-osconfig-agent\n```\n\n\n| **Note:** The package repository available from SUSE Linux Enterprise Server (SLES) might not have the latest OS Config agent available.\n\n\u003cbr /\u003e\n\nTo update the agent on SLES VMs, you can also do a reinstall of the\nagent using the Google-provided packages. To do an install\nusing Google-provided packages, see\n[Install the OS Config agent](/compute/docs/manage-os#agent-install).\n\n### Ubuntu\n\nTo update the agent on Ubuntu operating systems, run the\nfollowing commands: \n\n```\nsudo apt update\nsudo apt install google-osconfig-agent\n```\n\n\n| **Note:** The package repository available from Ubuntu might not have the latest OS Config agent available.\n\n\u003cbr /\u003e\n\nTo update the agent on Ubuntu VMs, we recommend that you do a\nreinstall of the agent using the Google-provided packages. To do an install\nusing Google-provided packages, see\n[Install the OS Config agent](/compute/docs/manage-os#agent-install).\n\n### Windows\n\nTo update the agent on Windows operating systems, run the\nfollowing command: \n\n```\ngooget install google-osconfig-agent\n```\n\n### Run a patch job\n\nAnother method of updating the OS Config agent is by running a patch job and\nspecifying the `exclusive_packages` flag. This patch job only updates the OS\nConfig agent on the target VMs.\n\nTo set the target VMs, you need to specify an \u003cvar translate=\"no\"\u003eINSTANCE_FILTER\u003c/var\u003e.\nFor more information about instance filters,\nsee [instance filters](/compute/docs/os-patch-management/create-patch-job#instance-filters). \n\n### CentOS/RHEL/Rocky\n\nTo update the agent for CentOS, Rocky Linux and RHEL VMs, run the\nfollowing command: \n\n```\ngcloud compute os-config patch-jobs execute INSTANCE_FILTER \\\n --yum-exclusive-packages=google-osconfig-agent\n```\n\n### Debian\n\nTo update the agent for Debian VMs, run the\nfollowing commands: \n\n```\ngcloud compute os-config patch-jobs execute INSTANCE_FILTER \\\n --apt-exclusive-packages=google-osconfig-agent\n```\n\n### SLES\n\nTo update the agent for SLES VMs, run the following command: \n\n```\ngcloud compute os-config patch-jobs execute INSTANCE_FILTER \\\n --zypper-exclusive-patches=google-osconfig-agent\n```\n\n\n| **Note:** The package repository available from SUSE Linux Enterprise Server (SLES) might not have the latest OS Config agent available.\n\n\u003cbr /\u003e\n\nTo update the agent on SLES VMs, you can also do a reinstall of the\nagent using the Google-provided packages. To do an install\nusing Google-provided packages, see\n[Install the OS Config agent](/compute/docs/manage-os#agent-install).\n\n### Ubuntu\n\nTo update the agent for Ubuntu VMs, run the\nfollowing commands: \n\n```\ngcloud compute os-config patch-jobs execute INSTANCE_FILTER \\\n --apt-exclusive-packages=google-osconfig-agent\n```\n\n\n| **Note:** The package repository available from Ubuntu might not have the latest OS Config agent available.\n\n\u003cbr /\u003e\n\nTo update the agent on Ubuntu VMs, we recommend that you do a\nreinstall of the agent using the Google-provided packages. To do an install\nusing Google-provided packages, see\n[Install the OS Config agent](/compute/docs/manage-os#agent-install).\n\n### Windows\n\nTo update the agent for Windows VMs, run the\nfollowing command:\n**Note:** This command also updates all the Google-provided software on the VM. \n\n```\ngcloud compute os-config patch-jobs execute INSTANCE_FILTER \\\n --windows-exclusive-patches=google-packages\n```"]]