Reputation: 3667
I'm trying to install curl
via Homebrew using brew install curl
.
However, the installation fails with:
The downloaded GitHub Packages manifest was corrupted or modified (it is not valid JSON
==> Downloading https://ghcr.io/v2/homebrew/core/brotli/manifests/1.0.9
Already downloaded: /Users/currentuser/Library/Caches/Homebrew/downloads/922ce7b351cec833f9bd2641f27d8ac011005f8b1f7e1119b8271cfb4c0d3cd7--brotli-1.0.9.bottle_manifest.json
Error: curl: Failed to download resource "brotli_bottle_manifest"
The downloaded GitHub Packages manifest was corrupted or modified (it is not valid JSON):
/Users/currentuser/Library/Caches/Homebrew/downloads/922ce7b351cec833f9bd2641f27d8ac011005f8b1f7e1119b8271cfb4c0d3cd7--brotli-1.0.9.bottle_manifest.json
What is the issue?
Upvotes: 5
Views: 20014
Reputation: 23572
TLDR: ensure you can access https://ghcr.io/v2/homebrew/core
In my case, GitHub Packages (ghcr.io) was being blocked by our corporate firewall. By default, Homebrew uses https://ghcr.io/v2/homebrew/core as the download source for bottles. This source URL is set by the HOMEBREW_BOTTLE_DOMAIN
environment variable.
The corporate firewall was intercepting the request for the GitHub Package manifest & responding with an HTML block page. Then, Homebrew stored and tried to parse the block page as a package manifest, which of course won't work. This results in the above 'corrupted' error.
To verify if this is the cause, try either of the below:
xxx.bottle_manifest.json
to .html
and try opening it to see if it displays a block pagemv /Users/xxx/Library/Caches/Homebrew/downloads/xxx.bottle_manifest.json page.html
open page.html
You need to request for https://ghcr.io/v2/homebrew/core
to be unblocked.
Upvotes: 1
Reputation: 31
I have also this problem with brew install php the problem persists even after deleting all the files from
/Users/currentuser/Library/Caches/Homebrew/downloads/
and
brew install php again
i have also tried
HOMEBREW_FORCE_BREWED_CURL=1 brew install openssl
Upvotes: 2
Reputation: 3667
The problem was resolved after delete /Users/currentuser/Library/Caches/Homebrew/downloads/922ce7b351cec833f9bd2641f27d8ac011005f8b1f7e1119b8271cfb4c0d3cd7--brotli-1.0.9.bottle_manifest.json
and run brew install curl
again
Upvotes: 14
Reputation: 2455
It might be using the installed curl instead of system curl. From man brew
set HOMEBREW_FORCE_BREWED_CURL
Upvotes: 2