Opam update fails with [ERROR] Could not update repository "default"

I tried updating opam today and after opam update I got the following error:

[default] synchronised from https://opam.ocaml.org
[ERROR] Could not update repository "default": "/opt/homebrew/bin/patch -p1 -i
        /Users/anjapetkovic/.opam/log/patch-56321-b4fb53" exited with code 1

I am using a mac with arch arm64 and I installed opam via brew (a long time ago).
I would appreciate any help with resolving this issue, as I cannot access the updates on any of the current opam switches.

Sorry about that. GNU patch has known issues, however there are solutions:

If running a beta version doesn’t suit you, you can instead do:

rm -rf ~/.opam/repo/default && opam update

Thank you! The beta release worked, but the rm -rf ~/.opam/repo/default && opam update did not.

1 Like