我正在Linux上运行azure。
uname -a
Linux kali 5.15.0-kali3-amd64 #1 SMP Debian 5.15.15-2kali1 (2022-01-31) x86_64 GNU/Linux
运行az --version
命令显示我已经安装了2.36.0
版本,并且有可用的更新。
az --version
azure-cli 2.36.0 *
core 2.36.0 *
telemetry 1.0.6
Extensions:
azure-devops 0.24.0
Dependencies:
msal 1.17.0
azure-mgmt-resource 21.0.0
Python location '/usr/bin/python3'
Extensions directory '/home/kali/.azure/cliextensions'
Extensions system directory '/usr/lib/python3/dist-packages/azure-cli-extensions'
Python (Linux) 3.9.12 (main, Mar 24 2022, 13:02:21)
[GCC 11.2.0]
Legal docs and information: aka.ms/AzureCliLegal
You have 2 updates available. Consider updating your CLI installation with 'az upgrade'
Please let us know how we are doing: https://aka.ms/azureclihats
and let us know if you're interested in trying out our newest features: https://aka.ms/CLIUXstudy
但是,当我运行az upgrade
命令时,对于最新版本(2.37.0,2.36.0-1)似乎有矛盾的陈述。
az upgrade
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Your current Azure CLI version is 2.36.0. Latest version available is 2.37.0.
Please check the release notes first: https://learn.microsoft.com/cli/azure/release-notes-azure-cli
Do you want to continue? (Y/n): y
Hit:1 http://kali.download/kali kali-rolling InRelease
Hit:2 https://packages.microsoft.com/repos/azure-cli stretch InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
azure-cli is already the newest version (2.36.0-1).
0 upgraded, 0 newly installed, 0 to remove and 27 not upgraded.
CLI upgrade failed or aborted.
有两个问题。
az --version
显示在az升级状态时安装了2.36.0
版本,我有2.36.0-1
2.37.0
发布于 2022-05-26 23:24:57
az --version
显示在az升级状态时安装了2.36.0
版本,我有2.36.0-1
在执行az update命令之后,它将还原azure-cli is already the newest version (2.36.0-1).
,这表明它没有更新到2.37.0版本。
2.37.0
只要支持安装,z升级就会在Windows、macOS、和某些Linux发行版上得到支持。它只允许您将升级到最新版本的。
--如果您使用Azure来执行Azure,您可能已经在使用最新的Azure安装。您必须等待Azure的下一次构建,除非有一个专门发布的小bug修复版本,因为Azure 不支持az升级。
如果azure已经是最新版本,运行az升级将验证和更新所有已安装的扩展。
要实现这一点,您可以使用以下解决方法:
z升级命令仍处于预览模式。目前,它正在PowerShell会话中工作。这是在Azure会话中不工作。
在您的Linux环境中,您必须使用z升级或apt升级命令来更新最新版本。
# using az command
az upgrade
(or)
# using apt-get command
sudo apt-get update && sudo apt-get upgrade
apt-get升级命令升级所有尚未更改依赖项的系统安装包。使用只升级CLI.。
或使自动更新避免此类冲突。
参考文献
https://stackoverflow.com/questions/72399876
复制