| ms.topic | include |
|---|---|
| ms.custom | devx-track-azurecli, linux-related-content |
-
Azure CLI 2.38.2 (released on June 21, 2024) is the latest version supported on SUSE Linux Enterprise Server (SLES) and OpenSUSE (Leap). Microsoft is no longer providing updates or bug fixes for these distributions.
-
SUSE maintains and supports packages provided by SUSE/OpenSUSE repositories.
-
In Azure, SUSE and OpenSUSE virtual machines (VMs) based on Azure Marketplace images already have the Azure CLI installed.
To install Azure CLI on SUSE/OpenSUSE, choose one of the following methods:
-
Use the Enterprise package provided by SUSE in the SUSE/OpenSUSE repositories.
-
Use the installation method described in the “Install script (any)” tab.
The RPM package of the Azure CLI depends on the python3 package.
sudo zypper install -y azure-cliTo install the most recent historical version of the Azure CLI using Microsoft repositories, follow these steps.
(This package has been tested with SLES 15 and OpenSUSE Leap 15.1)
-
Install
curl:sudo zypper install -y curl
-
Import the Microsoft repository key:
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
-
Create local
azure-clirepository information:sudo zypper addrepo --name 'Azure CLI' --check https://packages.microsoft.com/yumrepos/azure-cli azure-cli -
Update the
zypperpackage index and install:sudo zypper install --from azure-cli azure-cli
Input 2 to continue install by ignoring some of its dependencies.
You must first configure azure-cli repository information as shown previously. Available versions
can be found in the Azure CLI release notes.
-
View the available versions using this command:
zypper search --details --match-exact azure-cli
-
To install a specific version:
sudo zypper install --from azure-cli azure-cli=<version>-1.el7
[!INCLUDE az-upgrade]
You can also update the package with the zypper update command.
sudo zypper refresh
sudo zypper update azure-cli[!INCLUDE uninstall-boilerplate.md]
-
Remove the package from your system.
sudo zypper remove -y azure-cli
-
If you don't plan to reinstall the CLI, remove the repository information.
sudo zypper removerepo azure-cli
-
If you don't use other Microsoft packages, remove the Microsoft signing 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
[!INCLUDE remove-data-boilerplate.md]
Here are some common problems seen when installing with zypper. If you experience a problem not
covered here, file an issue on GitHub.
[!INCLUDE rpm-warning]
The OpenSUSE 15 VM has a preinstalled Azure CLI with version 2.0.45, which is outdated and has
issues with az login. Remove this version along with its dependencies before following the
Install instruction to add the latest Azure CLI:
sudo zypper rm -y --clean-deps azure-cliIf you updated the Azure CLI without removing the dependencies of version 2.0.45, its old
dependencies may affect the latest version of the Azure CLI. You need to add back the old version to
link to its dependencies and then remove azure-cli along with its dependencies:
# The package name may vary on different system version, run 'zypper --no-refresh info azure-cli' to check the source package format
sudo zypper install --oldpackage azure-cli-2.0.45-4.22.noarch
sudo zypper rm -y --clean-deps azure-cliOn SLES 12, the default python3 package is 3.4 and not supported by Azure CLI. You can first
follow step 1-3 of the install instruction to add the azure-cli repository. Then build a
higher version python3 from source. Finally, you can download the Azure CLI package and install it
without dependency.
You can use the following one command to install or update Azure CLI based on above steps. The
script installs Python 3.8 under /usr/local/azcli and makes Azure CLI use it by setting an alias
of az to PATH=/usr/local/azcli/bin:$PATH az. You can also download the script and modify it
according to your needs. For instance, you can change the Python version or install location.
curl -sL https://azurecliprod.blob.core.windows.net/sles12_install_v2.sh | sudo bashFor the first time install, remember to run the following command to activate the alias:
source ~/.bashrc[!INCLUDEconfigure-proxy]
You may also want to explicitly configure zypper (via yast2) to always use this proxy. To do so,
run the yast2 proxy command as superuser, and fill in the information presented in the form. If
you have a window manager available on your system, you can also use the Network Services > Proxy
pane in the YaST Control Center.
For advanced configuration or more information, see the OpenSUSE Proxy configuration documentation
To get the Microsoft signing key and get the package from our repository, your proxy needs to allow HTTPS connections to the following addresses:
https://packages.microsoft.comhttps://download.opensuse.org
[!INCLUDEtroubleshoot-wsl.md]
When a certificate is broken or outdated on a machine, you might receive an error indicating that curl failed to verify the legitimacy of the server, and therefore couldn't establish a secure connection. Update your certificate to correct the problem.
sudo zypper update-ca-certificates