Search code examples
linuxubuntuopam

Ubuntu Server - Opam installation issue


I am installing Ubuntu 18.04
I have done this before, and never had this issue, the installation of OPAM has always gone smoothly, except this time.

I run the code to install OPAM.

sudo apt install opam

The installation does not give any errors, everything seems to go normally.

Then I run this.

opam init

and this is my output

Checking for available remotes: rsync and local, git, mercurial, darcs. Perfect!
[WARNING] Recommended dependencies -- most packages rely on these:
            - m4


=-=- Fetching repository information =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[default] synchronized from https://opam.ocaml.org
[ERROR] Base package base-threads of compiler system not found! Ignored.
[ERROR] Base package base-bigarray of compiler system not found! Ignored.
[ERROR] Base package base-unix of compiler system not found! Ignored.
[ERROR] Inconsistent set of base compiler packages: {} needed but not included
        / { base-bigarray, base-threads, base-unix } extra
[ERROR] Initialisation failed
OpamGlobals.Exit(66)

Once this errors out, I am stuck and can not go any further.
As I mentioned at the top, I have installed this version of the server many times in the past, and installed OPAM without an issue, until now.
This is through Virtualbox, so I deleted the installment and reinstalled it again, thinking that maybe there was a bad install. But, I get the same error.

I did some researching through Google, and cannot find this exact issue, but found similar ones with this OPAM build issue.

An update. Performing as suggested by AndreasKralj

opam init --comp $1.2.2
Checking for available remotes: rsync and local, git, mercurial, darcs. Perfect!
[WARNING] Recommended dependencies -- most packages rely on these:
            - m4   
=-=- Fetching repository information =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[default] synchronized from https://opam.ocaml.org
Cannot find /home/darkness/.opam/compilers/.2.2/.2.2/.2.2.comp: .2.2 is not a valid compiler name.
[ERROR] Initialisation failed
OpamGlobals.Exit(1)

Any idea's on this one, will be greatly appreciated.
Wayne


Solution

  • To fix this issue, you'll need to do opam init --comp 1.2.2 to ensure ocaml is installed properly and set as the version you want.