Skip to content

Instantly share code, notes, and snippets.

@dbuenzli
Last active July 5, 2017 12:21
Show Gist options
  • Select an option

  • Save dbuenzli/93771b7a2cfc0bf74005907ba0fc97fc to your computer and use it in GitHub Desktop.

Select an option

Save dbuenzli/93771b7a2cfc0bf74005907ba0fc97fc to your computer and use it in GitHub Desktop.
opam 1.2.2 to 2.0.0 and back with brew on macOS

From opam 1.2.2 to 2.0.0 and back with homebrew on macOS

With these instructions you can try 2.0.0 for your day to day work but quickly and safely go back to 1.2.2 if you hit a wall. This maintains both setup entirely isolated.

Going to 2.0.0 for the first time:

> mv ~/.opam ~/.opam-v1 # Save your old setup, use cp -r if you want
                        # to upgrade your existing v1 install to v2
> brew unlink opam
> brew install opam@2
> opam init
> ...

Going back to 1.2.2:

> mv ~/.opam ~/.opam-v2
> mv ~/.opam-v1 ~/.opam
> brew unlink opam@2
> brew link opam

And... you get the idea, the reverse dance will bring you back to 2.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment