解除安裝 Distributor 套件 - AWS Systems Manager

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

解除安裝 Distributor 套件

您可以使用 AWS Management Console 或 AWS Command Line Interface (AWS CLI),透過使用 將Distributor套件從 AWS Systems Manager 受管節點解除安裝Run Command。 Distributor和 Run Command是 中的工具 AWS Systems Manager。在此版本中,您可以解除安裝一個套件版本。您可以解除安裝特定版本或預設版本。

重要

您使用 Distributor 安裝的套件只能使用 Distributor 解除安裝。否則,Systems Manager 仍然可以將應用程式註冊為 INSTALLED,並導致其他非預期的結果。

使用主控台解除安裝套件

您可以在 Systems Manager 主控台中使用 Run Command 解除安裝套件一次。Distributor 使用 AWS Systems Manager Run Command 來解除安裝套件。

使用主控台解除安裝套件
  1. 在 https://https://console.aws.amazon.com/systems-manager/ 開啟 AWS Systems Manager 主控台。

  2. 在導覽窗格中,選擇 Run Command

  3. 在 Run Command 首頁選擇 Run command (執行命令)

  4. 選擇 AWS-ConfigureAWSPackage 命令文件。

  5. Action (動作),選擇 Uninstall (解除安裝)

  6. Name (名稱) 輸入您想解除安裝的套件名稱。

  7. 對於 Targets (目標),選擇您想要如何鎖定受管節點。您可以指定目標共用的標籤索引鍵和值。您也可以選擇屬性來指定目標,屬性包括 ID、平台和 SSM Agent 版本等。

  8. 您可以使用進階選項來新增有關作業的註解、變更 Rate control (比率控制) 中的 Concurrency (並行) 和 Error threshold (錯誤閾值) 值、指定輸出選項,或設定 Amazon Simple Notification Service (Amazon SNS) 通知。如需詳細資訊,請參閱此指南中的從主控台執行命令

  9. 準備好解除安裝套件時,請選擇 Run (執行),然後選擇 View results (檢視結果)。

  10. 在命令清單中,選擇您剛剛執行的 AWS-ConfigureAWSPackage 命令。如果命令仍在進行中,選擇主控台右上角的重新整理圖示。

  11. Status (狀態) 列顯示 Success (成功) 或 Failed (失敗) 時,請選擇 Output (輸出) 標籤。

  12. 選擇 View output (檢視輸出)。此指令輸出頁面會顯示指令執行的結果。

使用 AWS CLI解除安裝套件

您可以使用 從受管節點 AWS CLI 解除安裝Distributor套件,方法是使用 Run Command。

使用 解除安裝套件 AWS CLI
  • 在 AWS CLI中執行以下命令。

    aws ssm send-command \ --document-name "AWS-ConfigureAWSPackage" \ --instance-ids "instance-IDs" \ --parameters '{"action":["Uninstall"],"name":["package-name (in same account) or package-ARN (shared from different account)"]}'

    以下是範例。

    aws ssm send-command \ --document-name "AWS-ConfigureAWSPackage" \ --instance-ids "i-02573cafcfEXAMPLE" \ --parameters '{"action":["Uninstall"],"name":["Test-ConfigureAWSPackage"]}'

如需有關可與 send-command 命令搭配使用的其他選項的資訊,請參閱 AWS CLI 命令參考send-command AWS Systems Manager 一節。