Install Azure CLI with zypper

For Linux distributions with zypper, such as openSUSE or SLES, there's a package available for the Azure CLI. This package has been tested with openSUSE 42.2 and SLES 12 SP 2.

Note

To install the CLI, you need the following software:

Install

  1. Install curl:

    sudo zypper install -y curl
    
  2. Import the Microsoft repository key:

    sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
    
  3. Create local azure-cli repository information:

    sudo zypper addrepo --name 'Azure CLI' --check https://packages.microsoft.com/yumrepos/azure-cli azure-cli
    
  4. Update the zypper package index and install:

    sudo zypper install --from azure-cli -y azure-cli
    

You can then run the Azure CLI with the az command. To sign in, use az login command.

  1. Run the login command.

    az login
    

    If the CLI can open your default browser, it will do so and load a sign-in page.

    Otherwise, you need to open a browser page and follow the instructions on the command line to enter an authorization code after navigating to https://aka.ms/devicelogin in your browser.

  2. Sign in with your account credentials in the browser.

To learn more about different authentication methods, see Sign in with Azure CLI.

Troubleshooting

Here are some common problems seen when installing with zypper. If you experience a problem not covered here, file an issue on github.

CLI fails to install or run on Windows Subsystem for Linux

Since Windows Subsystem for Linux (WSL) is a system call translation layer on top of the Windows platform, you might experience an error when trying to install or run the Azure CLI. The CLI relies on some features that may have a bug in WSL. If you experience an error no matter how you install the CLI, there's a good chance it's an issue with WSL and not with the CLI install process.

To troubleshoot your WSL installation and possibly resolve issues:

  • If you can, run an identical install process on a Linux machine or VM to see if it succeeds. If it does, your issue is almost certainly related to WSL. To start a Linux VM in Azure, see the create a Linux VM in the Azure Portal documentation.
  • Make sure that you're running the latest version of WSL. To get the latest version, update your Windows 10 installation.
  • Check for any open issues with WSL which might address your problem. Often there will be suggestions on how to work around the problem, or information about a release where the issue will be fixed.
  • If there are no existing issues for your problem, file a new issue with WSL and make sure that you include as much information as possible.

If you continue to have issues installing or running on WSL, consider installing the CLI for Windows.

Update

You can update the package with the zypper update command.

sudo zypper refresh
sudo zypper update azure-cli

Uninstall

If you decide to uninstall the Azure CLI, we're sorry to see you go. Before you uninstall, use the az feedback command to let us know what could be improved or fixed. Our goal is to make the Azure CLI bug-free and user-friendly. If you found a bug, we'd appreciate it if you file a GitHub issue.

  1. Remove the package from your system.

    sudo zypper remove -y azure-cli
    
  2. If you don't plan to reinstall the CLI, remove the repository information.

    sudo zypper removerepo azure-cli
    
  3. If you removed the repository information, also remove the Microsoft GPG signature key.

    MSFT_KEY=`rpm -qa gpg-pubkey /* --qf "%{version}-%{release} %{summary}\n" | grep Microsoft | awk '{print $1}'`
    sudo rpm -e --allmatches gpg-pubkey-$MSFT_KEY
    

    Next Steps

Now that you've installed the Azure CLI, take a short tour of its features and common commands.