brew: brew upgrade error
Verification
- I understand that if I ignore these instructions, my issue may be closed without review.
- I have retried my command with
--force. - I ran
brew update-reset && brew updateand retried my command. - I ran
brew doctor, fixed as many issues as possible and retried my command. - I have checked the instructions for reporting bugs.
- I made doubly sure this is not a checksum does not match error.
Description of issue
brew upgrade error
Command that failed
brew upgrade
Output of command with --verbose --debug
--remote-time --output /Users/jeremywang/Library/Caches/Homebrew/api/formula.json --compressed --silent https://formulae.brew.sh/api/formula.json
Warning: formula.json: update failed, falling back to cached version.
/opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --user-agent Homebrew/3.6.20-261-gb3a71ba\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 13.2\)\ curl/7.86.0 --header Accept-Language:\ en --fail --max-time 10 --location --remote-time --output /Users/jeremywang/Library/Caches/Homebrew/api/formula.json --compressed --silent https://formulae.brew.sh/api/formula.json
Warning: formula.json: update failed, falling back to cached version.
/opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --user-agent Homebrew/3.6.20-261-gb3a71ba\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 13.2\)\ curl/7.86.0 --header Accept-Language:\ en --fail --max-time 10 --location --remote-time --output /Users/jeremywang/Library/Caches/Homebrew/api/formula.json --compressed --silent https://formulae.brew.sh/api/formula.json
Warning: formula.json: update failed, falling back to cached version.
/opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --user-agent Homebrew/3.6.20-261-gb3a71ba\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 13.2\)\ curl/7.86.0 --header Accept-Language:\ en --fail --max-time 10 --location --remote-time --output /Users/jeremywang/Library/Caches/Homebrew/api/formula.json --compressed --silent https://formulae.brew.sh/api/formula.json
Warning: formula.json: update failed, falling back to cached version.
Error: Cannot download non-corrupt https://formulae.brew.sh/api/formula.json!
Error: Kernel.exit
/opt/homebrew/Library/Homebrew/utils.rb:165:in `exit'
/opt/homebrew/Library/Homebrew/utils.rb:165:in `odie'
/opt/homebrew/Library/Homebrew/api.rb:77:in `rescue in fetch_json_api_file'
/opt/homebrew/Library/Homebrew/api.rb:51:in `fetch_json_api_file'
/opt/homebrew/Library/Homebrew/api/formula.rb:21:in `all_formulae'
/opt/homebrew/Library/Homebrew/formulary.rb:667:in `loader_for'
/opt/homebrew/Library/Homebrew/formulary.rb:561:in `factory'
/opt/homebrew/Library/Homebrew/formulary.rb:609:in `from_keg'
/opt/homebrew/Library/Homebrew/formulary.rb:582:in `from_rack'
/opt/homebrew/Library/Homebrew/formula.rb:1870:in `block in installed'
/opt/homebrew/Library/Homebrew/formula.rb:1869:in `each'
/opt/homebrew/Library/Homebrew/formula.rb:1869:in `flat_map'
/opt/homebrew/Library/Homebrew/formula.rb:1869:in `installed'
/opt/homebrew/Library/Homebrew/cmd/upgrade.rb:135:in `upgrade_outdated_formulae'
/opt/homebrew/Library/Homebrew/cmd/upgrade.rb:116:in `upgrade'
/opt/homebrew/Library/Homebrew/brew.rb:105:in `<main>'
Output of brew doctor and brew config
Warning: formula.json: update failed, falling back to cached version.
Warning: formula.json: update failed, falling back to cached version.
Warning: formula.json: update failed, falling back to cached version.
Warning: formula.json: update failed, falling back to cached version.
Error: Cannot download non-corrupt https://formulae.brew.sh/api/formula.json!
Output of brew tap
buo/cask-upgrade
homebrew/bundle
homebrew/cask
homebrew/cask-drivers
homebrew/cask-fonts
homebrew/cask-versions
homebrew/command-not-found
homebrew/core
majd/repo
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 32 (14 by maintainers)
Commits related to this issue
- https://github.com/Homebrew/brew/issues/14516 — committed to delgurth/get-package by delgurth a year ago
@Kotodian, try doing
and see if that helps.
Same problem here. I followed each steps stated in this issue and finally it works. Thank you very much.
@Kotodian, please try
and see if it helps.
I have the same error
While
export HOMEBREW_NO_INSTALL_FROM_API=1does temporarily fix the issue, it only seems to mask the real problem. Or at least that’s what was happening to me. Here is what I found:The Error
brew updatefails to downloadformula.jsondue to aPermission deniederror:The Cause
Three of the files in
~/Library/Caches/Homebrew/api/(includingformula.json, specifically) somehow became owned byroot:The Fix
Change the ownership of the files back to your user:
Verify ownership is fixed:
And now
brew updateshould work great:rm -r "$(brew --cache)/api" && brew updatedoes nothingexport HOMEBREW_NO_INSTALL_FROM_API=1fixes the issue, on my computer at leastEdit: I’m seriously bad at markdown formatting
That’s a fair shout actually. Will look into that.
HOMEBREW_NO_INSTALL_FROM_APIis the default for now. There is no need to set it once you’ve donebrew update.What’s the output of
?
这是来自QQ邮箱的假期自动回复邮件。 您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。
@carlocab this is related to a different issue (it was opened before the GitHub issue started), so I’m not sure it’s been fixed yet.