az: 'upgrade' 不在 'az' 命令组中

az: 'upgrade' is not in the 'az' command group

我想在 linux(wsl ubuntu) 的 window 子系统中将 azure cli 从 2.0.81 升级到 2.26.1 版本。我正在尝试使用命令 az upgrade 。它给出以下错误:

az: 'upgrade' is not in the 'az' command group. See 'az --help'. If the command is from an extension, please make sure the corresponding extension is installed. To learn more about extensions, please visit https://docs.microsoft.com/en-us/cli/azure/azure-cli-extensions-overview

有什么方法可以在 ubuntu 中升级它吗?

很遗憾,您的 az cli 版本太旧,无法使用此功能。

来自documentation

The az upgrade command was added in version 2.11.0 and will not work with versions prior to 2.11.0. Older versions can be updated by reinstalling as described in Install the Azure CLI.

我得到了它的解决方案。我只是通过以下 link.

重新安装了 azure cli

https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt