Right way to upgrade my ocaml + packages?

I know I can build a nice shiny new 4.06 install using opam switch, but I’d like to have my new OCaml setup contain all the same opam packages as the old one did. What’s the right set of commands for that?

(In case this isn’t entirely clear: what I want is to build both a new OCaml 4.06 and rebuild all my existing installed packages for that new version of OCaml so my working environment will be minimally changed.)

1 Like

For that you can use the export/import capabilities from opam switch:

opam switch export <yourfile>
opam switch 4.06.0
opam switch import <yourfile>

If you want some of the packages not to be imported, just modify the import file, it is very straightforward.


Cool. I wish there was a single command that would more or less do that, but the combination of those three commands is good enough.

Now for the more messy problem that lots of stuff (like utop!) won’t build under 4.06 because of broken dependencies. :frowning:


incidentally, is there a table somewhere of the availability of the opam packages under various compiler versions?