formula cannot be installed, unauthorized error

2 min read Original article ↗

brew gist-logs <formula> link OR brew config AND brew doctor output

$ brew config

HOMEBREW_VERSION: 3.5.2
ORIGIN: https://github.com/Homebrew/brew
HEAD: fba051f98f609634ae4392d0053ddfc627f8cdb3
Last commit: 9 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: d1945aece64d3c5bbf47d6251311ebfa79f77c04
Core tap last commit: 63 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_CORE_GIT_REMOTE: https://github.com/Homebrew/homebrew-core
HOMEBREW_MAKE_JOBS: 12
Homebrew Ruby: 2.6.8 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: dodeca-core 64-bit kabylake
Clang: 13.1.6 build 1316
Git: 2.32.1 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.79.1 => /usr/bin/curl
macOS: 12.4-x86_64
CLT: 13.4.0.0.1.1651278267
Xcode: N/A


$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
  /Library/Frameworks/Python.framework/Versions/Current/bin/python3.9-config
  /Library/Frameworks/Python.framework/Versions/Current/bin/python3-config

Verification

  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.

What were you trying to do (and why)?

Install the awscli formula.

What happened (include all command output)?

Getting a 401 unauthorized error

==> Downloading https://ghcr.io/v2/homebrew/core/awscli/manifests/2.7.9
Already downloaded: /Users/alessandro.pogliaghi/Library/Caches/Homebrew/downloads/10837f67f49673c10580d8a2d740798eb7dda7ebc5be64e7eba59ec08cf2b03f--awscli-2.7.9.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/awscli/blobs/sha256:3ba49c8854ab24a49bf3cc4d847df86d4c3b38bb9a21916ef079adfe556dd95c
curl: (22) The requested URL returned error: 401

Error: awscli: Failed to download resource "awscli"
Download failed: https://ghcr.io/v2/homebrew/core/awscli/blobs/sha256:3ba49c8854ab24a49bf3cc4d847df86d4c3b38bb9a21916ef079adfe556dd95c

What did you expect to happen?

To correctly download the formula.

Step-by-step reproduction instructions (by running brew commands)