diff --git a/.openpublishing.redirection.json b/.openpublishing.redirection.json index 04c6d76d2f..9693672176 100644 --- a/.openpublishing.redirection.json +++ b/.openpublishing.redirection.json @@ -74,6 +74,22 @@ "source_path": "docs-ref-conceptual/azure-cli-extensions.md", "redirect_url": "/cli/azure/azure-cli-extensions-overview", "redirect_document_id": false + }, + + { + "source_path": "docs-ref-conceptual/install-azure-cli-yum.md", + "redirect_url": "/cli/azure/install-azure-cli-linux?pivots=yum", + "redirect_document_id": false + }, + { + "source_path": "docs-ref-conceptual/install-azure-cli-apt.md", + "redirect_url": "/cli/azure/install-azure-cli-linux?pivots=apt", + "redirect_document_id": false + }, + { + "source_path": "docs-ref-conceptual/install-azure-cli-zypper.md", + "redirect_url": "/cli/azure/install-azure-cli-linux?pivots=zypper", + "redirect_document_id": false } ] } diff --git a/docs-ref-conceptual/TOC.yml b/docs-ref-conceptual/TOC.yml index 2878a56c0e..8644db2c15 100644 --- a/docs-ref-conceptual/TOC.yml +++ b/docs-ref-conceptual/TOC.yml @@ -50,18 +50,9 @@ - name: Install - macOS href: install-azure-cli-macos.md displayName: install, macos, brew, homebrew, osx, os x, mac - - name: Install - Linux with apt - href: install-azure-cli-apt.md - displayName: ubuntu, debian, mint, linux, install, wsl - - name: Install - Linux with yum - href: install-azure-cli-yum.md - displayName: rhel, redhat, red hat, fedora, linux, install, wsl - - name: Install - Linux with zypper - href: install-azure-cli-zypper.md - displayName: opensuse, suse, sles, leap, tumbleweed, linux, install, wsl - - name: Install - Linux install script + - name: Install - Linux href: install-azure-cli-linux.md - displayName: install, script, unix, bsd, linux, lfs, wsl, slackware + displayName: install, script, unix, bsd, linux, lfs, wsl, slackware, ubuntu, debian, mint, opensuse, suse, sles, leap, tumbleweed, rhel, redhat, red hat, fedora - name: Update href: update-azure-cli.md displayName: update, upgrade diff --git a/docs-ref-conceptual/index.yml b/docs-ref-conceptual/index.yml index a4e6b37027..fa144fa13c 100644 --- a/docs-ref-conceptual/index.yml +++ b/docs-ref-conceptual/index.yml @@ -25,13 +25,7 @@ landingContent: url: install-azure-cli-windows.md - text: Install for macOS url: install-azure-cli-macos.md - - text: Install on Linux with apt - url: install-azure-cli-apt.md - - text: Install on Linux with yum - url: install-azure-cli-yum.md - - text: Install on Linux with zypper - url: install-azure-cli-zypper.md - - text: Install on Linux without a package manager + - text: Install on Linux url: install-azure-cli-linux.md - text: Run in Docker url: run-azure-cli-docker.md diff --git a/docs-ref-conceptual/install-azure-cli-apt.md b/docs-ref-conceptual/install-azure-cli-apt.md deleted file mode 100644 index 09368ea031..0000000000 --- a/docs-ref-conceptual/install-azure-cli-apt.md +++ /dev/null @@ -1,205 +0,0 @@ ---- -title: Install the Azure CLI on Linux with apt -description: How to install the Azure CLI with the apt package manager -author: dbradish-microsoft -ms.author: dbradish -manager: barbkess -ms.date: 09/29/2020 -ms.topic: conceptual -ms.service: azure-cli -ms.devlang: azurecli -ms.custom: devx-track-azurecli ---- - -# Install Azure CLI with apt - -If you are running a distribution that comes with `apt`, such as Ubuntu or Debian, there's an x86_64 package available -for the Azure CLI. This package has been tested with and is supported for: - -* Ubuntu trusty, xenial, bionic, eoan and focal -* Debian jessie, stretch, and buster - -[!INCLUDE [current-version](includes/current-version.md)] - -> [!NOTE] -> -> The package for Azure CLI installs its own Python interpreter, and does not use the -> system Python. -> -> On Ubuntu 20.04 (Focal), there is an `azure-cli` package with version `2.0.81` provided by the `focal/universe` repository. It's outdated and not recommended. If you already installed it, please remove it first by running `sudo apt remove azure-cli -y && sudo apt autoremove -y` before following the below steps to install the latest `azure-cli` package. - -## Install - -We offer two ways to install the Azure CLI with distributions that support `apt`: As an all-in-one script that -runs the install commands for you, and instructions that you can run as a step-by-step process on your own. - -### Install with one command - -We offer and maintain a script which runs all of the installation commands in one step. Run it by using `curl` -and pipe directly to `bash`, or download the script to a file and inspect it before running. - -> [!IMPORTANT] -> This script is only verified for Ubuntu 16.04+ and Debian 8+. It may not work on other distributions. -> If you're using a derived distribution such as Linux Mint, follow the manual install instructions and perform -> any necessary troubleshooting. - -```bash -curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash -``` - -### Manual install instructions - -If you don't want to run a script as superuser or the all-in-one script fails, follow these steps to install the Azure CLI. - -1. Get packages needed for the install process: - - ```bash - sudo apt-get update - sudo apt-get install ca-certificates curl apt-transport-https lsb-release gnupg - ``` - -2. Download and install the Microsoft signing key: - - ```bash - curl -sL https://packages.microsoft.com/keys/microsoft.asc | - gpg --dearmor | - sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null - ``` - -3.
Add the Azure CLI software repository: - - ```bash - AZ_REPO=$(lsb_release -cs) - echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | - sudo tee /etc/apt/sources.list.d/azure-cli.list - ``` - -4. Update repository information and install the `azure-cli` package: - - ```bash - sudo apt-get update - sudo apt-get install azure-cli - ``` - -Run the Azure CLI with the `az` command. To sign in, use the [az login](/cli/azure/reference-index#az-login) command. - -[!INCLUDE [interactive-login](includes/interactive-login.md)] - -To learn more about different authentication methods, see [Sign in with Azure CLI](authenticate-azure-cli.md). - -## Troubleshooting - -Here are some common problems seen when installing with `apt`. If you experience a problem not covered here, [file an issue on github](https://github.com/Azure/azure-cli/issues). - -### No module issue on Ubuntu 20.04 (Focal)/WSL -If you installed `azure-cli` on `Focal` without adding the Azure CLI software repository in [step 3](#set-release) of the manual install instructions or using our [script](#install-with-one-command), you may encounter issues such as no module named 'decorator' or 'antlr4' as the package you installed is the outdated `azure-cli 2.0.81` from the `focal/universe` repository. Please remove it first by running `sudo apt remove azure-cli -y && sudo apt autoremove -y`, then follow the above [instructions](#install) to install the latest `azure-cli` package. - -### lsb_release does not return the correct base distribution version - -Some Ubuntu- or Debian-derived distributions such as Linux Mint may not return the correct version name from `lsb_release`. This value is used in the install process to -determine the package to install. If you know the code name of the Ubuntu or Debian version your distribution is derived from, you can set the `AZ_REPO` value manually when -[adding the repository](#set-release). Otherwise, look up information for your distribution on how to determine the base distribution code name and set `AZ_REPO` to the correct value. - -### No package for your distribution - -Sometimes it may be a while after a distribution is released before there's an Azure CLI package available for it. The Azure CLI designed to be resilient with regards to future -versions of dependencies and rely on as few of them as possible. If there's no package available for your base distribution, try a package for an earlier distribution. - -To do this, set the value of `AZ_REPO` manually when [adding the repository](#set-release). For Ubuntu distributions use the `bionic` repository, and for Debian distributions -use `stretch`. Distributions released before Ubuntu Trusty and Debian Wheezy are not supported. - -### Elementary OS (EOS) fails to install the Azure CLI - -EOS fails to install the Azure cli because `lsb_release` returns `HERA`, which is the EOS release name. The solution is to fix the file `/etc/apt/sources.list.d/azure-cli.list` and change `hera main` to `bionic main`. - -Original file contents: - -``` -deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ hera main -``` - -Modified file contents - -``` -deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ bionic main -``` - -### Proxy blocks connection - -[!INCLUDE[configure-proxy](includes/configure-proxy.md)] - -You may also want to explicitly configure `apt` to use this proxy at all times. Make sure that the -following lines appear in an `apt` configuration file in `/etc/apt/apt.conf.d/`. We recommend using -either your existing global configuration file, an existing proxy configuration file, `40proxies`, -or `99local`, but follow your system administration requirements. - -```apt.conf -Acquire { - http::proxy "http://[username]:[password]@[proxy]:[port]"; - https::proxy "https://[username]:[password]@[proxy]:[port]"; -} -``` - -If your proxy does not use basic auth, __remove__ the `[username]:[password]@` portion of the proxy URI. If you require more information for proxy configuration, see the official Ubuntu documentation: - -* [apt.conf manpage](http://manpages.ubuntu.com/manpages/bionic/en/man5/apt.conf.5.html) -* [Ubuntu wiki - apt-get howto](https://help.ubuntu.com/community/AptGet/Howto#Setting_up_apt-get_to_use_a_http-proxy) - -In order to get the Microsoft signing key and get the package from our repository, your proxy needs to -allow HTTPS connections to the following address: - -* `https://packages.microsoft.com` - -[!INCLUDE[troubleshoot-wsl.md](includes/troubleshoot-wsl.md)] - -## Update -[!INCLUDE [az-upgrade](includes/az-upgrade.md)] - -You can also use `apt-get upgrade` to update the CLI package. - - ```bash - sudo apt-get update && sudo apt-get upgrade - ``` - -> [!NOTE] -> This command upgrades all of the installed packages on your system that have not had a dependency change. -> To upgrade the CLI only, use `apt-get install`. -> -> ```bash -> sudo apt-get update && sudo apt-get install --only-upgrade -y azure-cli -> ``` - -## Uninstall - -[!INCLUDE [uninstall-boilerplate.md](includes/uninstall-boilerplate.md)] - -1. Uninstall with `apt-get remove`: - - ```bash - sudo apt-get remove -y azure-cli - ``` - -2. If you don't plan to reinstall the CLI, remove the Azure CLI repository information: - - ```bash - sudo rm /etc/apt/sources.list.d/azure-cli.list - ``` - -3. If you use no other packages from Microsoft, remove the signing key: - - ```bash - sudo rm /etc/apt/trusted.gpg.d/microsoft.gpg - ``` - -4. Remove any unneeded packages: - - ```bash - sudo apt autoremove - ``` - -## Next Steps - -Now that you've installed the Azure CLI, take a short tour of its features and common commands. - -> [!div class="nextstepaction"] -> [Get started with the Azure CLI](get-started-with-azure-cli.md) diff --git a/docs-ref-conceptual/install-azure-cli-yum.md b/docs-ref-conceptual/install-azure-cli-yum.md deleted file mode 100644 index f56ed7cbe1..0000000000 --- a/docs-ref-conceptual/install-azure-cli-yum.md +++ /dev/null @@ -1,168 +0,0 @@ ---- -title: Install the Azure CLI on Linux with yum -description: How to install the Azure CLI with yum -author: dbradish-microsoft -ms.author: dbradish -manager: barbkess -ms.date: 11/24/2020 -ms.topic: conceptual -ms.service: azure-cli -ms.devlang: azurecli -ms.custom: devx-track-azurecli ---- - -# Install Azure CLI with yum - -For Linux distributions with `yum` such as RHEL, Fedora, or CentOS, there's a package -for the Azure CLI. This package has been tested with RHEL 7.7, RHEL 8, Fedora 24 and higher, CentOS 7 and CentOS 8. - -[!INCLUDE [current-version](includes/current-version.md)] - -[!INCLUDE [rpm-warning](includes/rpm-warning.md)] - -## Install - -1. Import the Microsoft repository key. - - ```bash - sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc - ``` - -2. Create local `azure-cli` repository information. - - ```bash - echo -e "[azure-cli] - name=Azure CLI - baseurl=https://packages.microsoft.com/yumrepos/azure-cli - enabled=1 - gpgcheck=1 - gpgkey=https://packages.microsoft.com/keys/microsoft.asc" | sudo tee /etc/yum.repos.d/azure-cli.repo - ``` - -3. Install with the `yum install` command. - - ```bash - sudo yum install azure-cli - ``` - -Run the Azure CLI with the `az` command. To sign in, use [az login](/cli/azure/reference-index#az-login) command. - -[!INCLUDE [interactive-login](includes/interactive-login.md)] - -To learn more about different authentication methods, see [Sign in with Azure CLI](authenticate-azure-cli.md). - -## Troubleshooting - -Here are some common problems seen when installing with `yum`. If you experience a problem not covered here, [file an issue on github](https://github.com/Azure/azure-cli/issues). - -### Install on RHEL 7.6 or other systems without Python 3 - -If you can, please upgrade your system to a version with official support for `python 3.6+` package. Otherwise, you need to first install a `python3` package then install Azure CLI without dependency. - -You can use the following one command to install Azure CLI with `python 3.6` built from source: -```bash -curl -sL https://azurecliprod.blob.core.windows.net/rhel7_6_install.sh | sudo bash -``` -You can also do it step by step: - -First, Azure CLI requires `SSL 1.1+` and you need to build `openssl 1.1` from source before building `python3`: -```bash -$ sudo yum install gcc gcc-c++ make ncurses patch wget tar zlib zlib-devel -y -# build openssl from source -$ cd ~ -$ wget https://www.openssl.org/source/openssl-1.1.1d.tar.gz -$ tar -xzf openssl-1.1.1d.tar.gz -$ cd openssl-1.1.1d -$ ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl -$ make -$ sudo make install -# configure shared object lookup directory so that libssl.so.1.1 can be found -$ echo "/usr/local/ssl/lib" | sudo tee /etc/ld.so.conf.d/openssl-1.1.1d.conf -# reload config -$ sudo ldconfig -v -``` - -Then build Python 3 from source: -```bash -$ PYTHON_VERSION="3.6.9" -$ PYTHON_SRC_DIR=$(mktemp -d) -$ wget -qO- https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz | tar -xz -C "$PYTHON_SRC_DIR" -$ cd $PYTHON_SRC_DIR/Python-$PYTHON_VERSION -$ ./configure --prefix=/usr --with-openssl=/usr/local/ssl -$ make -$ sudo make install -``` - -Finally, follow step 1 and 2 of the [install instruction](#install) to add Azure CLI repository. You can now download the package and install it without dependency. -```bash -$ sudo yum install yum-utils -y -$ sudo yumdownloader azure-cli -$ sudo rpm -ivh --nodeps azure-cli-*.rpm -``` - -As an alternative, you can also install Python 3 through some [additional repo](https://developers.redhat.com/blog/2018/08/13/install-python3-rhel/). Following this way, if you have set up `python3` but are still getting an error `python3: command not found` when trying to run the cli, you need to add it to your path. -```bash -$ scl enable rh-python36 bash -``` - -### Proxy blocks connection - -[!INCLUDE[configure-proxy](includes/configure-proxy.md)] - -You may also want to explicitly configure `yum` to use this proxy at all times. Make sure that the following -lines appear under the `[main]` section of `/etc/yum.conf`: - -```yum.conf -[main] -# ... -proxy=http://[proxy]:[port] # If your proxy requires https, change http->https -proxy_username=[username] # Only required for basic auth -proxy_password=[password] # Only required for basic auth -``` - -In order to get the Microsoft signing key and get the package from our repository, your proxy needs to -allow HTTPS connections to the following address: - -* `https://packages.microsoft.com` - -[!INCLUDE[troubleshoot-wsl.md](includes/troubleshoot-wsl.md)] - -## Update - -[!INCLUDE [az-upgrade](includes/az-upgrade.md)] - -You can also update the Azure CLI with the `yum update` command. - -```bash -sudo yum update azure-cli -``` - -## Uninstall - -[!INCLUDE [uninstall-boilerplate.md](includes/uninstall-boilerplate.md)] - -1. Remove the package from your system. - - ```bash - sudo yum remove azure-cli - ``` - -2. If you don't plan to reinstall the CLI, remove the repository information. - - ```bash - sudo rm /etc/yum.repos.d/azure-cli.repo - ``` - -3. If you don't use any other Microsoft packages, remove the signing key. - - ```bash - 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. - -> [!div class="nextstepaction"] -> [Get started with the Azure CLI](get-started-with-azure-cli.md) diff --git a/docs-ref-conceptual/install-azure-cli-zypper.md b/docs-ref-conceptual/install-azure-cli-zypper.md deleted file mode 100644 index 1f78b90d5f..0000000000 --- a/docs-ref-conceptual/install-azure-cli-zypper.md +++ /dev/null @@ -1,172 +0,0 @@ ---- -title: Install the Azure CLI on Linux with zypper -description: How to install the Azure CLI with zypper -author: dbradish-microsoft -ms.author: dbradish -manager: barbkess -ms.date: 09/25/2020 -ms.topic: conceptual -ms.service: azure-cli -ms.devlang: azurecli -ms.custom: devx-track-azurecli ---- - -# 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 Leap 15.1, and SLES 15. - -[!INCLUDE [current-version](includes/current-version.md)] - -[!INCLUDE [rpm-warning](includes/rpm-warning.md)] - -## Install - -1. Install `curl`: - - ```bash - sudo zypper install -y curl - ``` - -2. Import the Microsoft repository key: - - ```bash - sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc - ``` - -3. Create local `azure-cli` repository information: - - ```bash - sudo zypper addrepo --name 'Azure CLI' --check https://packages.microsoft.com/yumrepos/azure-cli azure-cli - ``` - -4. Update the `zypper` package index and install: - - ```bash - sudo zypper install --from azure-cli azure-cli - ``` - Input 2 to continue install by ignoring some of its dependencies. - -You can then run the Azure CLI with the `az` command. To sign in, use [az login](/cli/azure/reference-index#az-login) command. - -[!INCLUDE [interactive-login](includes/interactive-login.md)] - -To learn more about different authentication methods, see [Sign in with Azure CLI](authenticate-azure-cli.md). - -## Troubleshooting - -Here are some common problems seen when installing with `zypper`. If you experience a problem not covered here, [file an issue on github](https://github.com/Azure/azure-cli/issues). - -### NotImplementedError on OpenSUSE 15 VM -The OpenSUSE 15 VM has a pre-installed Azure CLI with version `2.0.45`, it's outdated and has issues with `az login`. Please remove it along with its dependencies before following the [Install](#install) instruction to add the latest Azure CLI: -```bash -sudo zypper rm -y --clean-deps azure-cli -``` - -If you updated Azure CLI without removing the dependencies of version `2.0.45`, its old dependencies may affect the latest version of Azure CLI. You need to add back the old version to link to its dependencies and then remove `azure-cli` along with its dependencies: -```bash -# 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-cli -``` - - -### Install on SLES 12 or other systems without Python 3.6 - -On 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](#install) 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 Azure CLI (be aware that your existing Python 3 version will be overridden by Python 3.6): -```bash -curl -sL https://azurecliprod.blob.core.windows.net/sles12_install.sh | sudo bash -``` - -Or you can do it step by step: - -```bash -# !Please add azure-cli repository first following step 1-3 of the install instruction before running below commands -$ sudo zypper refresh -$ sudo zypper install -y gcc gcc-c++ make ncurses patch wget tar zlib-devel zlib openssl-devel -# Download Python source code -$ PYTHON_VERSION="3.6.9" -$ PYTHON_SRC_DIR=$(mktemp -d) -$ wget -qO- https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz | tar -xz -C "$PYTHON_SRC_DIR" -# Build Python -# Please be aware that with --prefix=/usr, the command will override the existing Python 3 version -$ $PYTHON_SRC_DIR/*/configure --prefix=/usr -$ make -$ sudo make install -# Download azure-cli package -$ AZ_VERSION=$(zypper --no-refresh info azure-cli |grep Version | awk -F': ' '{print $2}' | awk '{$1=$1;print}') -$ wget https://packages.microsoft.com/yumrepos/azure-cli/azure-cli-$AZ_VERSION.x86_64.rpm -# Install without dependency -$ sudo rpm -ivh --nodeps azure-cli-$AZ_VERSION.x86_64.rpm -``` - -### Proxy blocks connection - -[!INCLUDE[configure-proxy](includes/configure-proxy.md)] - -You may also want to explicitly configure `zypper` (via `yast2`) to use this proxy at all times. 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](https://www.suse.com/documentation/slms1/book_slms/data/sec_wy_config_updates_proxy.html) - -In order 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.com` -* `https://download.opensuse.org` - -[!INCLUDE[troubleshoot-wsl.md](includes/troubleshoot-wsl.md)] - -### SSL certificate problem - -When a certificate is broken or outdated on a machine, you may receive an error indicating that curl failed to verify the legitimacy of the server and therefore could not establish a secure connection. Update your certificate to correct the problem. - -```bach -sudo zypper update-ca-certificates -``` - -## Update - -[!INCLUDE [az-upgrade](includes/az-upgrade.md)] - -You can also update the package with the `zypper update` command. - -```bash -sudo zypper refresh -sudo zypper update azure-cli -``` - -## Uninstall - -[!INCLUDE [uninstall-boilerplate.md](includes/uninstall-boilerplate.md)] - -1. Remove the package from your system. - - ```bash - sudo zypper remove -y azure-cli - ``` - -2. If you don't plan to reinstall the CLI, remove the repository information. - - ```bash - sudo zypper removerepo azure-cli - ``` - -3. If you don't use other Microsoft packages, remove the Microsoft signing key. - - ```bash - 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. - -> [!div class="nextstepaction"] -> [Get started with the Azure CLI](get-started-with-azure-cli.md) \ No newline at end of file