Installing az Azure CLI on Debian Linux questions

John Larew 0 Reputation points
2026-07-26T16:53:47.7466667+00:00

I know the command to install the Azure CLI on a Debian Linux system:

curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash


Is there a corresponding uninstall script?

Does the above command install the az command in the system space, or the space of the current user? Is this a parameter controlled choice? Thanks in advance for any insight you can provide,

Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Jose Benjamin Solis Nolasco 11,541 Reputation points Volunteer Moderator
    2026-07-27T02:23:17.5233333+00:00

    Welcome to Microsoft Q&A

    Hello @John Larew , I hope you are doing well.

    The command:

    curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
    

    installs the Azure CLI system-wide on Debian-based Linux distributions. The use of sudo means the installation is performed with administrative privileges and is not limited to the current user.

    For uninstalling Azure CLI, there is no separate uninstall script corresponding to the installation script. Since the installation uses the system package manager, you can remove it with:

    sudo apt remove azure-cli
    

    If you also want to remove the package configuration files:

    sudo apt purge azure-cli
    

    You can then optionally remove unused dependencies:

    sudo apt autoremove
    

    The installation location and package management are handled by APT, so the installation is system-wide rather than user-specific. The InstallAzureCLIDeb script does not provide a parameter to switch between a per-user and system-wide installation.

    You can verify the installed version with:

    az version
    

    And check the location of the executable with:

    which az
    

    References:

    Install Azure CLI on Linux

    Azure CLI documentation

    If my answer helped you, please consider marking it as accepted. This helps others in the community find similar solutions.

    Was this answer helpful?


  2. AI answer

    2026-07-26T16:54:02.67+00:00

    For Debian/Ubuntu, the documented install methods are:

    1. One-command install:
    curl -fsSL 'https://azurecliprod.blob.core.windows.net/$root/deb_install.sh' | sudo bash
    
    1. Step-by-step install with apt, ending with:
    sudo apt-get install azure-cli
    

    The documented uninstall command for the Debian/Ubuntu package is:

    sudo apt remove azure-cli
    

    The documentation does not provide a separate uninstall script for Azure CLI on Debian/Ubuntu.

    The install is system-wide, not per-user, because it uses sudo and installs the package through the system package manager. For Debian and Ubuntu, the Azure CLI is installed in:

    /opt/az/
    

    User-specific configuration is stored separately in:

    $HOME/.azure
    

    The documentation does not describe a parameter to choose between system-space and current-user installation for the Debian/Ubuntu package-based install.

    If Azure CLI data also needs to be removed, the documented data location is $HOME/.azure. Deleting that directory removes user-specific CLI data. Warning: removing that directory deletes local Azure CLI configuration and cached data for that user.


    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.