Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to install Azure CLI on Ubuntu system #30529

Open
Xiaojing123456 opened this issue Dec 17, 2024 · 6 comments
Open

Fail to install Azure CLI on Ubuntu system #30529

Xiaojing123456 opened this issue Dec 17, 2024 · 6 comments
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team. Similar-Issue
Milestone

Comments

@Xiaojing123456
Copy link

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

@Xiaojing123456 Xiaojing123456 added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Dec 17, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Dec 17, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Dec 17, 2024

Thank you for opening this issue, we will look into it.

Copy link

Here are some similar issues that might help you. Please check if they can solve your problem.

@yonzhan yonzhan added the Azure CLI Team The command of the issue is owned by Azure CLI team label Dec 17, 2024
@yonzhan yonzhan added this to the Backlog milestone Dec 17, 2024
@bebound
Copy link
Contributor

bebound commented Dec 17, 2024

This does not make sense. The manually step and one-line script follows the same logic.

Can you run sudo rm -rf /var/lib/apt/lists/* && sudo apt-get update and then sudo apt-get install azure-cli? (#30278 (comment))

It seems to be the same network issue as #30278.

@yonzhan yonzhan added Service Attention This issue is responsible by Azure service team. and removed Azure CLI Team The command of the issue is owned by Azure CLI team labels Dec 17, 2024
@Xiaojing123456
Copy link
Author

I run sudo rm -rf /var/lib/apt/lists/* && sudo apt-get update ,getting error
Get:45 http://azure.archive.ubuntu.com/ubuntu jammy-security/universe amd64 c-n-f Metadata [19.5 kB]
Get:46 http://azure.archive.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [37.6 kB]
Get:47 http://azure.archive.ubuntu.com/ubuntu jammy-security/multiverse Translation-en [8260 B]
Get:48 http://azure.archive.ubuntu.com/ubuntu jammy-security/multiverse amd64 c-n-f Metadata [224 B]
Get:49 https://packages.microsoft.com/repos/azure-cli jammy InRelease [3596 B]
Err:49 https://packages.microsoft.com/repos/azure-cli jammy InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
Reading package lists... Done
W: GPG error: https://packages.microsoft.com/repos/azure-cli jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
E: The repository 'https://packages.microsoft.com/repos/azure-cli jammy InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Then i run sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EB3E94ADBE1229CF && apt-get update, still get
root@U2204-2:~# sudo apt-get update
Hit:1 http://azure.archive.ubuntu.com/ubuntu jammy InRelease
Ign:2 https://packages.microsoft.com/repos/azure-cli jammy InRelease
Hit:3 http://azure.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:4 http://azure.archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:5 http://azure.archive.ubuntu.com/ubuntu jammy-security InRelease
Ign:2 https://packages.microsoft.com/repos/azure-cli jammy InRelease
Ign:2 https://packages.microsoft.com/repos/azure-cli jammy InRelease
Err:2 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.

@bebound
Copy link
Contributor

bebound commented Dec 17, 2024

Reported to PMC team, waiting for reply.

@mbearup
Copy link

mbearup commented Dec 17, 2024

@Xiaojing123456 this appears to have been a regional caching error in Azure Front Door. I've purged the file from cache. Let us know if you continue to encounter issues.
For future reference, issues with the packages.microsoft.com infrastructure can be reported to our GitHub repo. We don't support package issues there (i.e. bad dependencies, broken packages, etc) but we do support infrastructure issues (failed downloads, etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team. Similar-Issue
Projects
None yet
Development

No branches or pull requests

4 participants