Install Azure CLI in Ubuntu 24.04

In this article, we cover how to install Azure CLI in Ubuntu 24.04 release. Azure command-line interface (or, Azure CLI) is used to interact with and manage Azure resources. The package isn’t available through the standard Ubuntu repository. Hence, we have to install the relevant package through a script that is maintained by the team managing Azure CLI.

Note: The following operations require Administrative rights. We advise you to contact your System Administrator if you don’t have the required rights.

Install Azure CLI in Ubuntu 24.04

Open a terminal and issue the following:

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

One of the advantages of using the script directly is that we don’t have to issue multiple commands. The script itself would update the repository, install necessary dependencies, add repository keys, and install the most recent package available for our Operating System.

It is worth mentioning here that, you should check the contents of the script yourself. Download the script and see what all it does.

Once done, we will verify the installation through:

az version

It should return with:

"azure-cli": "2.55.0"

which is the latest stable release at the time of writing.

In conclusion, we have covered here how to install Azure CLI in the Ubuntu 24.04 release.

Additional Info:

Updating Azure CLI

If you want to update it to the latest version then use:

az upgrade

Remove Azure CLI

If, for some reason, you would want to remove the package. Then, remove the installation files first:

sudo apt purge --auto-remove azure-cli

And, remove the keys and repository data files:

sudo rm /etc/apt/trusted.gpg.d/microsoft.gpg
sudo rm /etc/apt/sources.list.d/azure-cli.list

Similar Posts