Ubuntu 服务器 - Opam 安装问题

Ubuntu Server - Opam installation issue

我正在安装 Ubuntu 18.04
我以前做过这个,从来没有遇到过这个问题,OPAM的安装一直很顺利,除了这次。

我运行安装OPAM的代码。

sudo apt install opam

安装没有报错,一切正常。

那我运行这个。

opam init

这是我的输出

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)

一旦出现这个错误,我就卡住了,不能再继续了。
正如我在顶部提到的,我过去已经多次安装这个版本的服务器,并且安装 OPAM 没有问题,直到现在。
这是通过Virtualbox,所以我删除了安装并重新安装它,认为可能是安装错误。但是,我得到了同样的错误。

我通过 Google 进行了一些研究,但找不到这个确切的问题,但发现了与此 OPAM 构建问题类似的问题。

更新。按照 AndreasKralj

的建议执行
opam init --comp .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)

如有任何想法,将不胜感激。
韦恩

要解决此问题,您需要执行 opam init --comp 1.2.2 以确保正确安装 ocaml 并将其设置为所需的版本。