Generic (distribution independant) way to install Azure CLI
Official documentation is: https://docs.microsoft.com/install-azure-cli-linux
Both install and update
curl -L https://aka.ms/InstallAzureCli | bash
Downloading Azure CLI install script from https://azurecliprod.blob.core.windows.net/install.py to /tmp/azure_cli_install_tmp_yl6EWO. ######################################################################## 100.0% /tmp/azure_cli_install_tmp_yl6EWO: OK Running install script. -- Verifying Python version. -- Python version 3.10.6 okay. -- Verifying native dependencies. -- Unable to verify native dependencies. dist=arch linux, version=None. Continuing... ===> In what directory would you like to place the install? (leave blank to use '/home/mihamina/lib/azure-cli'): -- '/home/mihamina/lib/azure-cli' is not empty and may contain a previous installation. ===> Remove this directory? (y/N): y
I choose "Yes" here, it's just my choice
Then we continue
===> Remove this directory? (y/N): y -- Deleted '/home/mihamina/lib/azure-cli'. -- Creating directory '/home/mihamina/lib/azure-cli'. -- We will install at '/home/mihamina/lib/azure-cli'. ===> In what directory would you like to place the 'az' executable? (leave blank to use '/home/mihamina/bin'): -- The executable will be in '/home/mihamina/bin'. -- Downloading virtualenv package from https://pypi.python.org/packages/source/v/virtualenv/virtualenv-16.7.11.tar.gz. -- Downloaded virtualenv package to /tmp/tmpjq0ydq19/virtualenv-16.7.11.tar.gz. -- Checksum of /tmp/tmpjq0ydq19/virtualenv-16.7.11.tar.gz OK. -- Extracting '/tmp/tmpjq0ydq19/virtualenv-16.7.11.tar.gz' to '/tmp/tmpjq0ydq19'. -- Executing: ['/usr/bin/python3', 'virtualenv.py', '--python', '/usr/bin/python3', '/home/mihamina/lib/azure-cli'] /tmp/tmpjq0ydq19/virtualenv-16.7.11/virtualenv.py:24: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives import distutils.spawn /tmp/tmpjq0ydq19/virtualenv-16.7.11/virtualenv.py:25: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead import distutils.sysconfig Already using interpreter /usr/bin/python3 Using base prefix '/usr' New python executable in /home/mihamina/lib/azure-cli/bin/python3 Also creating executable in /home/mihamina/lib/azure-cli/bin/python Installing setuptools, pip, wheel... done. -- Executing: ['/home/mihamina/lib/azure-cli/bin/pip', 'install', '--cache-dir', '/tmp/tmpjq0ydq19', 'azure-cli', '--upgrade'] ... ... ... Building wheels for collected packages: antlr4-python3-runtime Building wheel for antlr4-python3-runtime (setup.py) ... done Created wheel for antlr4-python3-runtime: filename=antlr4_python3_runtime-4.9.3-py3-none-any.whl size=144554 sha256=9ff15dfb17ad07611a98dc4608988d0521f9262273cc342bb8b55d83227339ce Stored in directory: /tmp/tmpjq0ydq19/wheels/12/93/dd/1f6a127edc45659556564c5730f6d4e300888f4bca2d4c5a88 Successfully built antlr4-python3-runtime Installing collected packages: ..., ..., ..., ..., ... ..., ..., ..., ..., ... ..., ..., ..., ..., ... ..., ..., ..., ..., ... -- The executable is available at '/home/mihamina/bin/az'. -- Created tab completion file at '/home/mihamina/lib/azure-cli/az.completion' ===> Modify profile to update your $PATH and enable shell/tab completion now? (Y/n): Y ===> Enter a path to an rc file to update (leave blank to use '/home/mihamina/.bashrc'): -- Backed up '/home/mihamina/.bash_profile' to '/home/mihamina/.bash_profile.backup' -- Tab completion set up complete. -- If tab completion is not activated, verify that '/home/mihamina/.bash_profile' is sourced by your shell.