2

To install OPAM (with ocaml already installed) I followed this guide: https://github.com/realworldocaml/book/wiki/Installation-Instructions. Here are the steps I made to install OPAM

$ sudo add-apt-repository ppa:avsm/ppa
$ sudo apt-get update
$ sudo apt-get install curl build-essential m4 ocaml opam
$ opam init (and choose yes)
$ eval `opam config env`
$ opam switch 4.02.3

Whenever I try to install any package (like utop) I get this error:

Fatal error:
# opam-version    1.2.2
# os              linux
Cannot remove /home/leonard/.opam/archives/camomile.0.8.5+opam.tar.gz (# opam-version    1.2.2
# os              linux
opam: "unlink" failed on /home/leonard/.opam/archives/camomile.0.8.5+opam.tar.gz: Permission denied).

Any ideas on what I did wrong?

Leoking938
  • 71
  • 1
  • 2
  • 11
  • 3
    I suggest to remove your `.opam` directory `/home/leonard/.opam` then start over from `opam init`. If it still fails, probably your `umask` setting is wrong. – camlspotter Mar 31 '16 at 04:41
  • 1
    Is it possible you did some of your opam setup with sudo? Anyway, start anew is good advice. – Str. Mar 31 '16 at 11:44
  • So far seems like opam init has been set up incorrectly. Any ideas how to reinit opam? – Leoking938 Mar 31 '16 at 13:27
  • perhaps will help you? https://stackoverflow.com/questions/74708063/how-does-one-install-opam-without-sudo-priveledges-on-linux-ubuntu – Charlie Parker Dec 06 '22 at 19:28

0 Answers0