首页 > 解决方案 > Ubuntu 服务器 - Opam 安装问题

问题描述

我正在安装 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,所以我删除了分期并重新安装了它,认为可能有一个错误的安装。但是,我得到同样的错误。

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

更新。按照 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)

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

标签: linuxubuntuopam

解决方案


要解决此问题,您需要opam init --comp 1.2.2确保 ocaml 已正确安装并设置为您想要的版本。


推荐阅读