5

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?

Ermiya Eskandary
  • 15,323
  • 3
  • 31
  • 44
new2cpp
  • 3,311
  • 5
  • 28
  • 39
  • 1
    What does `brew doctor` output? – JBallin Aug 10 '22 at 04:49
  • almost empty. but most errors I met is `Error: openssl@3: Failed to download resource "ca-certificates_bottle_manifest" The downloaded GitHub Packages manifest was corrupted or modified (it is not valid JSON): ` – new2cpp Aug 10 '22 at 06:07
  • `Error: curl: Failed to download resource "ca-certificates_bottle_manifest" The downloaded GitHub Packages manifest was corrupted or modified (it is not valid JSON): /Users/user/Library/Caches/Homebrew/downloads/c95acf8107b31ec83053f411f74e85b2626e1a0c051467aff6b98acf996883d7--ca-certificates-2022-07-19_1.bottle_manifest.json Error: 'curl' must be installed and in your PATH! Failed during: /usr/local/bin/brew update --force --quiet` any idea how to resolve it? – new2cpp Aug 10 '22 at 06:18
  • Try [uninstalling homebrew](https://docs.brew.sh/FAQ#how-do-i-uninstall-homebrew) and then reinstalling it. – JBallin Aug 10 '22 at 06:24
  • `~ % /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)" curl: (77) error setting certificate verify locations: CAfile: /etc/ssl/certs/ca-certificates.crt CApath: none` – new2cpp Aug 10 '22 at 06:40
  • This just happened to me as well--it was solved by removing all the faulty manifest.json files. – Jay Lee Aug 12 '22 at 13:09

5 Answers5

13

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

new2cpp
  • 3,311
  • 5
  • 28
  • 39
  • Had a similar problem with a different package on my system (open-mpi), and deleting these cached downloads fixed it for me too. – drmrgd Aug 11 '22 at 13:02
  • Had the same problem with kbr5 & postgresql. You saved my day! – Mayra Navarro Jan 30 '23 at 22:17
  • For me the only thing that worked was to delete _all_ files in the .../Homebrew/downloads/ directory, then run brew install curl. Thanks! – fabpub May 12 '23 at 13:08
8

This command fixed the issue for me:

brew cleanup
Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Neetu
  • 91
  • 1
  • 4
1

It might be using the installed curl instead of system curl. From man brew

set HOMEBREW_FORCE_BREWED_CURL

jmvcollaborator
  • 2,141
  • 1
  • 6
  • 17
1

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

NeverSleeps
  • 1,439
  • 1
  • 11
  • 39
user14550
  • 21
  • 2
  • my prevoius download issue caused by my company vpn/proxy. After turn off company proxy, delete cached download, re-install again, the issue is resloved. Please pay attention whether you have some vpn/proxy is on. – new2cpp Aug 11 '22 at 16:34
  • @new2cpp he was right for my issue. For me company vpn needed to be enabled since I am using company brew. – Poyraz Tahan Jun 17 '23 at 18:15
0

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:

  • Open https://ghcr.io/v2/homebrew/core in a web browser to see if it's accessible or blocked
  • Change the manifest file extension e.g. xxx.bottle_manifest.json to .html and try opening it to see if it displays a block page
mv /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.

Ermiya Eskandary
  • 15,323
  • 3
  • 31
  • 44