Skip to content

Fail to install Azure CLI on Ubuntu system #30529

@Xiaojing123456

Description

@Xiaojing123456

Describe the bug

When I follow https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt#option-2-step-by-step-installation-instructions to install Azure CLI on Azure Ubuntu VM, Some errors are returned,

Related command

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -sLS https://packages.microsoft.com/keys/microsoft.asc |
gpg --dearmor | sudo tee /etc/apt/keyrings/microsoft.gpg > /dev/null
sudo chmod go+r /etc/apt/keyrings/microsoft.gpg
AZ_DIST=$(lsb_release -cs)
echo "Types: deb
URIs: https://packages.microsoft.com/repos/azure-cli/
Suites: ${AZ_DIST}
Components: main
Architectures: $(dpkg --print-architecture)
Signed-by: /etc/apt/keyrings/microsoft.gpg" | sudo tee /etc/apt/sources.list.d/azure-cli.sources
sudo apt-get update
sudo apt-get install azure-cli

Errors

root@U2204-2:~# sudo apt-get update
Hit:1 http://azure.archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://azure.archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:3 https://packages.microsoft.com/repos/azure-cli jammy InRelease
Hit:4 http://azure.archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:5 http://azure.archive.ubuntu.com/ubuntu jammy-security InRelease
Ign:3 https://packages.microsoft.com/repos/azure-cli jammy InRelease
Ign:3 https://packages.microsoft.com/repos/azure-cli jammy InRelease
Err:3 https://packages.microsoft.com/repos/azure-cli jammy InRelease
Bad header line Bad header data [IP: 13.107.246.74 443]
Reading package lists... Done
W: Failed to fetch https://packages.microsoft.com/repos/azure-cli/dists/jammy/InRelease Bad header line Bad header data [IP: 13.107.246.74 443]
W: Some index files failed to download. They have been ignored, or old ones used instead.

Issue script & Debug output

none

Expected behavior

Please help check what's going wrong and fix it

Environment Summary

Ubuntu 22.04 & 24.04 both have same issue.

Currently, I can install CLI through command curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash

Reference document https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt#option-1-install-with-one-command

Additional context

No response

Metadata

Metadata

Assignees

Labels

Service AttentionThis issue is responsible by Azure service team.Similar-IssuebugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions