Install Docker Cli Ubuntu

Installing Docker on Ubuntu 18.04.5 (Bionic) Perform the following steps to install Docker 19.03.8 on Bionic: Remove the older version of Docker. Sudo apt-get remove docker docker-engine docker-ce docker-ce-cli docker.io containerd runc. Install containerd. The CLI on Linux allows the execution of various commands through a terminal using interactive command-line prompts or a script. When you are ready to install the Azure CLI on Linux, it is recommended to use a Linux distribution's package manager. Select the appropriate package manager for your distribution from the options above. Notice that docker-ce is not installed, but the candidate for installation is from the Docker repository for Ubuntu 20.04 ( focal ). Finally, install Docker: sudo apt install docker-ce. Docker should now be installed, the daemon started, and the process enabled to start on boot. Enable snaps on Ubuntu and install docker-cli-dashboard. Snaps are applications packaged with all their dependencies to run on all popular Linux distributions from a single build. They update automatically and roll back gracefully. Snaps are discoverable and installable from the Snap Store, an app store with an audience of millions.

-->

The Azure CLI is a cross-platform command-line tool that can be installed locally on Linux computers. You can use the Azure CLI on Linux to connect to Azure and execute administrative commands on Azure resources. The CLI on Linux allows the execution of various commands through a terminal using interactive command-line prompts or a script.When you are ready to install the Azure CLI on Linux, it is recommended to use a Linux distribution's package manager. Select the appropriate package manager for your distribution from the options above. If you do not have one of the listed package managers, you may manually install the Azure CLI on Linux by selecting the Install script option.

The current version of the Azure CLI is 2.28.0. For information about the latest release, see the release notes. To find your installed version and see if you need to update, run az version.

Overview

The apt package manager contains an x86_64 package for the Azure CLI that has been tested on the following distributions.

DistributionVersion
Ubuntu14.04 LTS (Trusty Tahir), 16.04 LTS (Xenial Xerus), 18.04 LTS (Bionic Beaver), 20.04 LTS (Focal Fossa), 20.10 (Groovy Gorilla)
DebianDebian 8 (Jessie), Debian 9 (Stretch), Debian 10 (Buster)

Warning

Ubuntu 20.04 (Focal Fossa) and 20.10 (Groovy Gorilla) include an azure-cli package with version 2.0.81 provided by the universe repository. This package is outdated and not recommended. If this package is installed, remove the package before continuing by running the command sudo apt remove azure-cli -y && sudo apt autoremove -y.

The azure-cli deb package does not support ARM64 architecture.

Installation Options

There are two options to install the Azure CLI on your system. First, you may execute a single command that will download an install script and run the install commands for you. Or if you prefer, you can execute the install commands yourself in a step-by-step process. Both methods are provided below.

Option 1: Install with one command

The Azure CLI team maintains a script to run all installation commands in one step. This script is downloaded via curl and piped directly to bash to install the CLI.

If you wish to inspect the contents of the script yourself before executing, simply download the script first using curl and inspect it in your favorite text editor.

Option 2: Step-by-step installation instructions

If you prefer a step-by-step installation process, complete the following steps to install the Azure CLI.

  1. Get packages needed for the install process:

  2. Download and install the Microsoft signing key:

  3. Update repository information and install the azure-cli package:

Sign in to Azure with the Azure CLI

Run the Azure CLI with the az command. To sign in, use the az login command.

  1. Run the login command.

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

    Otherwise, open a browser page at https://aka.ms/devicelogin and enter theauthorization code displayed in your terminal.

    If no web browser is available or the web browser fails to open, use device code flow with az login --use-device-code.

  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 apt. If you experience a problem not covered here, file an issue on github.

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 of the manual install instructions or using our script, 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 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 todetermine 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 whenadding the repository. 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 futureversions 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. For Ubuntu distributions use the bionic repository, and for Debian distributionsuse 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:

Modified file contents

Proxy blocks connection

If you're unable to connect to an external resource due to a proxy, make sure that you've correctly set the HTTP_PROXY and HTTPS_PROXY variables in your shell. You will need to contact your system administratorto know what host(s) and port(s) to use for these proxies.

These values are respected by many Linux programs, including those which are used in the installprocess. To set these values:

Important

If you are behind a proxy, these shell variables must be set to connect to Azure services with the CLI.If you are not using basic auth, it's recommended to export these variables in your .bashrc file.Always follow your business' security policies and the requirements of your system administrator.

You may also want to explicitly configure apt to use this proxy at all times. Make sure that thefollowing lines appear in an apt configuration file in /etc/apt/apt.conf.d/. We recommend usingeither your existing global configuration file, an existing proxy configuration file, 40proxies,or 99local, but follow your system administration requirements.

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:

In order to get the Microsoft signing key and get the package from our repository, your proxy needs toallow HTTPS connections to the following address:

  • https://packages.microsoft.com

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 theWindows platform, you might experience an error when trying to install or run the Azure CLI. The CLI relies onsome 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 thecreate 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 wherethe issue will be fixed.
  • If there are no existing issues for your problem, file a new issue with WSLand 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

The CLI provides an in-tool command to update to the latest version:

Note

The az upgrade command was added in version 2.11.0 and will not work with versions prior to 2.11.0. Older versions can be updated by reinstalling as described in Install the Azure CLI.

This command will also update all installed extensions by default. For more az upgrade options, please refer to the command reference page.

You can also use apt-get upgrade to update the CLI package.

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.

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 knowwhat 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. Uninstall with apt-get remove:

  2. If you don't plan to reinstall the CLI, remove the Azure CLI repository information:

  3. If you use no other packages from Microsoft, remove the signing key:

  4. Remove any unneeded packages:

Overview

For Linux distributions with dnf such as RHEL, Fedora, or CentOS, there's a packagefor the Azure CLI. This package has been tested with RHEL 7.7, RHEL 8, Fedora 24 and higher, CentOS 7 and CentOS 8.

The current version of the Azure CLI is 2.28.0. For information about the latest release, see the release notes. To find your installed version and see if you need to update, run az version.

Important

The RPM package of the Azure CLI depends on the python3 package. On your system, this may bea Python version which predates the requirement of Python 3.6.x. If this affects you, find areplacement python3 package.

Be aware that Python 2 has reached the end of life on January 1, 2020, and will no longer receiveupdates. Azure CLI has dropped support for Python 2.7 since version 2.1.0. New versions no longerguarantee to run with Python 2.7 correctly.

Note

Use yum package manager if you are using Linux systems that don't support dnf package manager.

Install

  1. Import the Microsoft repository key.

  2. Create local azure-cli repository information.

  3. Install with the dnf install command.

Run the Azure CLI with the az command. To sign in, use az login command.

  1. Run the login command.

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

    Otherwise, open a browser page at https://aka.ms/devicelogin and enter theauthorization code displayed in your terminal.

    If no web browser is available or the web browser fails to open, use device code flow with az login --use-device-code.

  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 dnf. If you experience a problem not covered here, file an issue on GitHub.

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:

You can also do it step by step:

Install docker cli ubuntu free

First, Azure CLI requires SSL 1.1+ and you need to build openssl 1.1 from source before building python3:

Then build Python 3 from source:

Finally, follow step 1 and 2 of the install instruction to add Azure CLI repository. You can now download the package and install it without dependency.

Note

In case you don't have the dnf download plugin installed, you will encounter command not found error on executing the below code. Use dnf install 'dnf-command(download)' to install the dnf download plugin.

As an alternative, you can also install Python 3 through some additional repo. 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.

Proxy blocks connection

If you're unable to connect to an external resource due to a proxy, make sure that you've correctly set the HTTP_PROXY and HTTPS_PROXY variables in your shell. You will need to contact your system administratorto know what host(s) and port(s) to use for these proxies.

These values are respected by many Linux programs, including those which are used in the installprocess. To set these values:

Important

Install Docker Cli Ubuntu

If you are behind a proxy, these shell variables must be set to connect to Azure services with the CLI.If you are not using basic auth, it's recommended to export these variables in your .bashrc file.Always follow your business' security policies and the requirements of your system administrator.

You may also want to explicitly configure dnf to use this proxy at all times. Make sure that the followinglines appear under the [main] section of /etc/dnf/dnf.conf:

In order to get the Microsoft signing key and get the package from our repository, your proxy needs toallow HTTPS connections to the following address:

  • https://packages.microsoft.com

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 theWindows platform, you might experience an error when trying to install or run the Azure CLI. The CLI relies onsome 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 thecreate 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 wherethe issue will be fixed.
  • If there are no existing issues for your problem, file a new issue with WSLand 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

The CLI provides an in-tool command to update to the latest version:

Note

The az upgrade command was added in version 2.11.0 and will not work with versions prior to 2.11.0. Older versions can be updated by reinstalling as described in Install the Azure CLI.

This command will also update all installed extensions by default. For more az upgrade options, please refer to the command reference page.

You can also update the Azure CLI with the dnf update command.

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 knowwhat 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.

  2. If you don't plan to reinstall the CLI, remove the repository information.

  3. If you don't use any other Microsoft packages, remove the signing key.

Overview

For Linux distributions with zypper, such as openSUSE or SLES, there's a package availablefor the Azure CLI. This package has been tested with openSUSE Leap 15.1, and SLES 15.

The current version of the Azure CLI is 2.28.0. For information about the latest release, see the release notes. To find your installed version and see if you need to update, run az version.

Important

The RPM package of the Azure CLI depends on the python3 package. On your system, this may bea Python version which predates the requirement of Python 3.6.x. If this affects you, find areplacement python3 package.

Be aware that Python 2 has reached the end of life on January 1, 2020, and will no longer receiveupdates. Azure CLI has dropped support for Python 2.7 since version 2.1.0. New versions no longerguarantee to run with Python 2.7 correctly.

Install

  1. Install curl:

  2. Import the Microsoft repository key:

  3. Create local azure-cli repository information:

  4. Update the zypper package index and install:

    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 command.

  1. Run the login command.

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

    Otherwise, open a browser page at https://aka.ms/devicelogin and enter theauthorization code displayed in your terminal.

    If no web browser is available or the web browser fails to open, use device code flow with az login --use-device-code.

  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.

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 instruction to add the latest 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:

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 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 will install Python 3.8 under /usr/local/azcli and make 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.

For the first time install, remember to run the following command to activate the alias:

Proxy blocks connection

If you're unable to connect to an external resource due to a proxy, make sure that you've correctly set the HTTP_PROXY and HTTPS_PROXY variables in your shell. You will need to contact your system administratorto know what host(s) and port(s) to use for these proxies.

These values are respected by many Linux programs, including those which are used in the installprocess. To set these values:

Important

If you are behind a proxy, these shell variables must be set to connect to Azure services with the CLI.If you are not using basic auth, it's recommended to export these variables in your .bashrc file.Always follow your business' security policies and the requirements of your system administrator.

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 windowmanager 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 theOpenSUSE Proxy configuration documentation

In order to get the Microsoft signing key and get the package from our repository, your proxy needs toallow HTTPS connections to the following addresses:

  • https://packages.microsoft.com
  • https://download.opensuse.org

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 theWindows platform, you might experience an error when trying to install or run the Azure CLI. The CLI relies onsome 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 thecreate 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 wherethe issue will be fixed.
  • If there are no existing issues for your problem, file a new issue with WSLand 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.

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.

Update

The CLI provides an in-tool command to update to the latest version:

Note

The az upgrade command was added in version 2.11.0 and will not work with versions prior to 2.11.0. Older versions can be updated by reinstalling as described in Install the Azure CLI.

This command will also update all installed extensions by default. For more az upgrade options, please refer to the command reference page.

You can also update the package with the zypper update command.

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 knowwhat 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.

  2. If you don't plan to reinstall the CLI, remove the repository information.

  3. If you don't use other Microsoft packages, remove the Microsoft signing key.

Docker install ubuntu shell script

Overview

Note

It's strongly recommend to install the CLI with a package manager. A package manager makes sure you always get the latest updates,and guarantees the stability of CLI components. Check and see if there is a package for your distribution beforeinstalling manually.

The CLI requires the following software:

Install Docker Cli Ubuntu Latest

  • Python 3.6.x, 3.7.x or 3.8.x.

Important

The CLI has dropped support for Python 2.7 since version 2.1.0. New versions no longerguarantee to run with Python 2.7 correctly.

Install or update

Both installing and updating the CLI requires re-running the install script. Install the CLI by running curl.

The script can also be downloaded and run locally. You may have to restart your shell in order for changes to take effect.

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

  1. Run the login command.

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

    Otherwise, open a browser page at https://aka.ms/devicelogin and enter theauthorization code displayed in your terminal.

    If no web browser is available or the web browser fails to open, use device code flow with az login --use-device-code.

  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 during a manual installation. If you experience a problem not covered here, file an issue on GitHub.

curl 'Object Moved' error

If you get an error from curl related to the -L parameter, or an error message including the text 'Object Moved', try usingthe full URL instead of the aka.ms redirect:

az command not found

If you can't run the command after installation and using bash or zsh, clear your shell's command hash cache. Run

and check if the problem is resolved.

The issue can also occur if you didn't restart your shell after installation. Make sure that the location of the az command is in your $PATH. The locationof the az command is

Proxy blocks connection

If you're unable to connect to an external resource due to a proxy, make sure that you've correctly set the HTTP_PROXY and HTTPS_PROXY variables in your shell. You will need to contact your system administratorto know what host(s) and port(s) to use for these proxies.

These values are respected by many Linux programs, including those which are used in the installprocess. To set these values:

Important

If you are behind a proxy, these shell variables must be set to connect to Azure services with the CLI.If you are not using basic auth, it's recommended to export these variables in your .bashrc file.Always follow your business' security policies and the requirements of your system administrator.

In order to get the installation scripts, your proxy needs to allow HTTPS connections to thefollowing addresses:

  • https://aka.ms/
  • https://azurecliprod.blob.core.windows.net/
  • https://pypi.python.org
  • Endpoints used by your distribution's package manager (if any) for core packages

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 theWindows platform, you might experience an error when trying to install or run the Azure CLI. The CLI relies onsome 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 thecreate 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 wherethe issue will be fixed.
  • If there are no existing issues for your problem, file a new issue with WSLand 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.

Uninstall

Docker Install Ubuntu Shell Script

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 knowwhat 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.

Uninstall the CLI by directly deleting the files from the location chosen at the time of installation. The default install location is $HOME.

  1. Remove the installed CLI files.

  2. Modify your $HOME/.bash_profile file to remove the following line:

  3. If using bash or zsh, reload your shell's command cache.

Install Docker Cli Ubuntu 64-bit

Remove data

If you don't plan to reinstall Azure CLI, remove its data.

Next Steps

Install Azure Cli Ubuntu Docker

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