Я пытаюсь установить OCaml в Windows с помощью WSL. Я выполнил следующие инструкции: Установите WSL
Поэтому я открыл PowerShell и набрал wsl --install
После перезагрузки я запустил командную строку Windows от имени администратора и вот мой вывод:
C:\Windows\System32>ubuntu
Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: florianingerl
New password:
Retype new password:
passwd: password updated successfully
Installation successful!
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.15.153.1-microsoft-standard-WSL2 x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
This message is shown once a day. To disable it please create the
/home/florianingerl/.hushlogin file.
florianingerl@FLORI-LENOVO-93:~$ bash -c "sh <(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)"
## Downloading opam 2.1.6 for linux on x86_64...
## Downloaded.
## Where should it be installed ? [/usr/local/bin]
Write access to '/usr/local/bin' required, using 'sudo'.
Command: install -m 755 /tmp/opam-2.1.6-x86_64-linux /usr/local/bin/opam
[sudo] password for florianingerl:
## opam 2.1.6 installed to /usr/local/bin
## Run this script again with '--restore ' to revert.
florianingerl@FLORI-LENOVO-93:~$ opam --version
2.1.6
florianingerl@FLORI-LENOVO-93:~$ ocaml --version
Command 'ocaml' not found, but can be installed with:
sudo apt install ocaml-interp
florianingerl@FLORI-LENOVO-93:~$ sudo apt install ocaml-interp
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package ocaml-interp
florianingerl@FLORI-LENOVO-93:~$ opam init -y
No configuration file found, using built-in defaults.
Checking for available remotes: rsync and local, git.
- you won't be able to use mercurial repositories unless you install the hg command on your system.
- you won't be able to use darcs repositories unless you install the darcs command on your system.
[WARNING] Recommended dependencies -- most packages rely on these:
- make
- cc
[ERROR] Missing dependencies -- the following commands are required for opam to operate:
- unzip
- bwrap: Sandboxing tool bwrap was not found. You should install 'bubblewrap'. See
https://opam.ocaml.org/doc/FAQ.html#Why-does-opam-require-bwrap.
Я совершенно новичок в Ubuntu. Я просто хочу установить OCaml. Итак, как мне теперь установить компилятор OCaml через Opam или иначе. Каковы команды для установки unzip или bwrap, если их необходимо установить в первую очередь. Как установить дюну после установки ocaml?
Для установки ocaml и dune используйте opam, а не менеджер пакетов вашей ОС.
opam update
opam switch create 5.2.0
Для дюны:
opam install dune
Спасибо! После установки unzip, bwrap, компилятора c и make эти команды работали нормально!