After running it through opam init git+https://github.com/ocaml/opam-repository.git, it works and pass this step, but having another error now:
[ERROR] Failed to get extra source "gen_ocaml_config.ml.in" of ocaml-config.3: Download failed
[ERROR] Failed to get extra source "gen_ocaml_config.ml.in" of ocaml-system.5.1.1: Download failed
∗ installed base-bigarray.base
∗ installed base-threads.base
∗ installed base-unix.base
∗ installed host-arch-arm64.1
∗ installed host-system-other.1
#=== ERROR while fetching sources for ocaml-system.5.1.1 ======================#
OpamSolution.Fetch_fail("https://raw.githubusercontent.com/ocaml/opam-source-archives/main/patches/ocaml-system/gen_ocaml_config.ml.in (download failed)")
#=== ERROR while fetching sources for ocaml-config.3 ==========================#
OpamSolution.Fetch_fail("https://raw.githubusercontent.com/ocaml/opam-source-archives/main/patches/ocaml-config/gen_ocaml_config.ml.in.3 (download failed)")
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
┌─ The following actions failed
│ ⬇ fetch ocaml-config 3
│ ⬇ fetch ocaml-system 5.1.1
└─
┌─ The following changes have been performed (the rest was aborted)
│ ∗ install base-bigarray base
│ ∗ install base-threads base
│ ∗ install base-unix base
│ ∗ install host-arch-arm64 1
│ ∗ install host-system-other 1
└─
# Run eval $(opam env --switch=default) to update the current shell environment
Switch initialisation failed: clean up? ('n' will leave the switch partially installed) [y/n] y
[NOTE] Opam has been initialised, but the initial switch creation failed.
Use 'opam switch create <compiler>' to get started.