MicrosoftDocs/azure-docs-cli

Linux install instructions hard-coded to amd64

Closed this issue · 6 comments

Prerequisites

  • Write a descriptive title.
  • Search the existing issues.
  • I am reporting the documentation problem for the current version of Azure CLI.

Azure CLI version being used

n/a

Link to affected document

https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux

Description of the documentation error

Under: Option 2 (step by step), part 3, "add the Azure CLI software repository":

Issue: the bash script assumes the architecture is amd64, which leads to installing incorrect/useless software without error.

Currently:

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

Suggested fix

you could use dpkg --print-architecture to fix (at least it will have error if arch not supported by azure cli)

AZ_REPO=$(lsb_release -cs)
echo "deb [arch=`dpkg --print-architecture`] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" |
    sudo tee /etc/apt/sources.list.d/azure-cli.list

This will then print

deb [arch=arm64] https://packages.......
or
deb [arch=amd64] https://packages.......

@tom-haines

Thanks for your feedback! We will investigate and update as appropriate.

It would be great if you could add a link to the documentation you are following for these steps? This would help us redirect the issue to the appropriate team. Thanks!!

It is in the description under "Link to affected document":
https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux

Also, the embedded version of python installed is incorrect under arm64; I had to manually replace python3 binaries. A simpler option may be to depend on python3 package via the package manager (as you do for libc for example).

@tom-haines

Thanks for your feedback! We have assigned the issue to author and will provide further updates.

Agree with @tom-haines : submitted pull request to change arch to current arch as submitted. will close when pull request is approved

This was resolved per suggestion