linux - 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)
对此有任何想法,将不胜感激。
韦恩
解决方案
要解决此问题,您需要opam init --comp 1.2.2
确保 ocaml 已正确安装并设置为您想要的版本。
推荐阅读
- c# - 如何检查字符串是否包含 EpiFind 中的值?
- windows - % Processor Time 的单位是什么,它表示什么?
- command - 由命令触发的 Minecraft 事件处理程序
- mongodb - 使用空手道自动测试 MongoDB 的正确方法
- java - Hibernate 在使用查询缓存时执行 N+1 个选择而不是 1 个查询
- mysql - Sequelize findAll 不是函数 4
- r - 根据其他列中的值,在数据框中创建具有升序值的新列
- assembly - 如何从程序集调用 cobol 程序 (z/os IBM)
- amazon-web-services - 错误管道步骤“无服务器部署”显示“IamRoleLambdaExecution - 角色 XXXXX 的最大策略大小超过 10240 字节”
- bash - 如果第一列中的值匹配并且第二列中的值与bash中另一个文件中的值不匹配,则提取行