Search code examples
macospiphomebrewazure-cliapple-m1

Install azure cli via brew not working in mac m1


I have be trying to install azure cli in new mac m1. But it fails. I get the following error

brew reinstall azure-cli
==> Downloading https://ghcr.io/v2/homebrew/core/azure-cli/manifests/2.22.1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/azure-cli/blobs/sha256:1980c967
==> Downloading from https://pkg-containers-az.githubusercontent.com/ghcr1/blobs
######################################################################## 100.0%
==> Reinstalling azure-cli 
==> Pouring azure-cli--2.22.1.arm64_big_sur.bottle.tar.gz
🍺  /opt/homebrew/Cellar/azure-cli/2.22.1: 19,449 files, 329.3MB

After Pouring it just stops. I also tried to install using pip3 and I can install that successfully but when I type "az" command I get the following error

/opt/homebrew/bin/az: line 2: 64784 Killed: 9               AZ_INSTALLER=HOMEBREW /opt/homebrew/Cellar/azure-cli/2.22.1/libexec/bin/python -m azure.cli "$@"

Solution

  • As mentioned in the comments: My python3 wasn't installed via brew. So first uninstalled brew and python3. Then installed brew again(before that made sure Rosetta 2 is working). Then tried brew doctor. There was error saying /usr/... then, I deleted those files. Once successfully removed/deleted brew doctor will run fine.