Initial switch creation failed: Failed to get sources of ocaml-base-compiler.5.1.1

When I do opam init --disable-sandboxing after installing opam following instruction from opam - Install, the initial switch creation failed with the error message [ERROR] Failed to get sources of ocaml-base-compiler.5.1.1: …

Lab30902% sudo add-apt-repository ppa:avsm/ppa
 Latest stable versions of OCaml and OPAM.
 More info: https://launchpad.net/~avsm/+archive/ubuntu/ppa
Press [ENTER] to continue or Ctrl-c to cancel adding it.

Get:1 file:/var/cuda-repo-ubuntu2004-11-6-local  InRelease
Ign:1 file:/var/cuda-repo-ubuntu2004-11-6-local  InRelease
Get:2 file:/var/cudnn-local-repo-ubuntu2004-8.4.0.27  InRelease
Ign:2 file:/var/cudnn-local-repo-ubuntu2004-8.4.0.27  InRelease
Get:3 file:/var/cuda-repo-ubuntu2004-11-6-local  Release [564 B]
Get:4 file:/var/cudnn-local-repo-ubuntu2004-8.4.0.27  Release [564 B]
Get:3 file:/var/cuda-repo-ubuntu2004-11-6-local  Release [564 B]                                     
Get:4 file:/var/cudnn-local-repo-ubuntu2004-8.4.0.27  Release [564 B]                                
Get:5 file:/var/cuda-repo-ubuntu2004-11-6-local  Release.gpg [836 B]                                 
Get:5 file:/var/cuda-repo-ubuntu2004-11-6-local  Release.gpg [836 B]                                                              
Hit:6 http://tw.archive.ubuntu.com/ubuntu focal InRelease                                                                                      
Hit:8 https://packages.microsoft.com/repos/vscode stable InRelease                                                
Hit:9 http://security.ubuntu.com/ubuntu focal-security InRelease           
Hit:10 http://ppa.launchpad.net/avsm/ppa/ubuntu focal InRelease
Hit:11 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal InRelease
Reading package lists... Done
Lab30902% sudo apt update
Get:1 file:/var/cuda-repo-ubuntu2004-11-6-local  InRelease
Ign:1 file:/var/cuda-repo-ubuntu2004-11-6-local  InRelease
Get:2 file:/var/cudnn-local-repo-ubuntu2004-8.4.0.27  InRelease
Ign:2 file:/var/cudnn-local-repo-ubuntu2004-8.4.0.27  InRelease
Get:3 file:/var/cuda-repo-ubuntu2004-11-6-local  Release [564 B]
Get:4 file:/var/cudnn-local-repo-ubuntu2004-8.4.0.27  Release [564 B]
Get:3 file:/var/cuda-repo-ubuntu2004-11-6-local  Release [564 B]                                                                                         
Get:5 file:/var/cuda-repo-ubuntu2004-11-6-local  Release.gpg [836 B]                                                                                     
Get:4 file:/var/cudnn-local-repo-ubuntu2004-8.4.0.27  Release [564 B]                                                                                    
Get:5 file:/var/cuda-repo-ubuntu2004-11-6-local  Release.gpg [836 B]                                                                                     
Hit:6 http://tw.archive.ubuntu.com/ubuntu focal InRelease                                                                                                
Hit:7 https://packages.microsoft.com/repos/vscode stable InRelease                                                                                       
Hit:9 http://security.ubuntu.com/ubuntu focal-security InRelease                                                                                 
Hit:10 http://ppa.launchpad.net/avsm/ppa/ubuntu focal InRelease
Hit:11 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
143 packages can be upgraded. Run 'apt list --upgradable' to see them.
Lab30902% sudo apt install opam
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  opam
0 upgraded, 1 newly installed, 0 to remove and 143 not upgraded.
Need to get 0 B/3,193 kB of archives.
After this operation, 15.2 MB of additional disk space will be used.
Selecting previously unselected package opam.
(Reading database ... 209576 files and directories currently installed.)
Preparing to unpack .../opam_2.1.0-0ppa1~focal_amd64.deb ...
Unpacking opam (2.1.0-0ppa1~focal) ...
Setting up opam (2.1.0-0ppa1~focal) ...
Processing triggers for man-db (2.9.1-1) ...
Lab30902% opam init --disable-sandboxing
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.


<><> Fetching repository information ><><><><><><><><><><><><><><><><><><><><><>
[default] Initialised

<><> Required setup - please read <><><><><><><><><><><><><><><><><><><><><><><>

  In normal operation, opam only alters files within ~/.opam.

  However, to best integrate with your system, some environment variables
  should be set. If you allow it to, this initialisation step will update
  your zsh configuration by adding the following line to ~/.zshrc:

    [[ ! -r /mnt/r11921a02/DS920/.opam/opam-init/init.zsh ]] || source /mnt/r11921a02/DS920/.opam/opam-init/init.zsh  > /dev/null 2> /dev/null

  Otherwise, every time you want to access your opam installation, you will
  need to run:

    eval $(opam env)

  You can always re-run this setup with 'opam init' later.

Do you want opam to modify ~/.zshrc? [N/y/f]
(default is 'no', use 'f' to choose a different file) y

User configuration:
  ~/.zshrc is already up-to-date.

<><> Creating initial switch 'default' (invariant ["ocaml" {>= "4.05.0"}] - initially with ocaml-base-compiler) 

<><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><><><>
Switch invariant: ["ocaml" {>= "4.05.0"}]

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
βˆ— installed base-bigarray.base
βˆ— installed base-threads.base
βˆ— installed base-unix.base
βˆ— installed ocaml-options-vanilla.1
[ERROR] Failed to get sources of ocaml-base-compiler.5.1.1: "/usr/bin/cp -PRp /tmp/opam-1225150-676d95/ocaml-5.1.1/.depend
        /tmp/opam-1225150-676d95/ocaml-5.1.1/.depend.menhir /tmp/opam-1225150-676d95/ocaml-5.1.1/.gitattributes
        /tmp/opam-1225150-676d95/ocaml-5.1.1/.github /tmp/opam-1225150-676d95/ocaml-5.1.1/.gitignore /tmp/opam-1225150-676d95/ocaml-5.1.1/.gitmodules
        /tmp/opam-1225150-676d95/ocaml-5.1.1/.mailmap /tmp/opam-1225150-676d95/ocaml-5.1.1/.ocp-indent
        /tmp/opam-1225150-676d95/ocaml-5.1.1/BOOTSTRAP.adoc /tmp/opam-1225150-676d95/ocaml-5.1.1/CODE_OF_CONDUCT.md
        /tmp/opam-1225150-676d95/ocaml-5.1.1/CONTRIBUTING.md /tmp/opam-1225150-676d95/ocaml-5.1.1/Changes
        /tmp/opam-1225150-676d95/ocaml-5.1.1/HACKING.adoc /tmp/opam-1225150-676d95/ocaml-5.1.1/INSTALL.adoc /tmp/opam-1225150-676d95/ocaml-5.1.1/LICENSE
        /tmp/opam-1225150-676d95/ocaml-5.1.1/Makefile /tmp/opam-1225150-676d95/ocaml-5.1.1/Makefile.best_binaries
        /tmp/opam-1225150-676d95/ocaml-5.1.1/Makefile.build_config.in /tmp/opam-1225150-676d95/ocaml-5.1.1/Makefile.common
        /tmp/opam-1225150-676d95/ocaml-5.1.1/Makefile.config.in /tmp/opam-1225150-676d95/ocaml-5.1.1/Makefile.config_if_required
        /tmp/opam-1225150-676d95/ocaml-5.1.1/Makefile.dev /tmp/opam-1225150-676d95/ocaml-5.1.1/Makefile.menhir
        /tmp/opam-1225150-676d95/ocaml-5.1.1/README.adoc /tmp/opam-1225150-676d95/ocaml-5.1.1/README.win32.adoc
        /tmp/opam-1225150-676d95/ocaml-5.1.1/VERSION /tmp/opam-1225150-676d95/ocaml-5.1.1/aclocal.m4 /tmp/opam-1225150-676d95/ocaml-5.1.1/api_docgen
        /tmp/opam-1225150-676d95/ocaml-5.1.1/appveyor.yml /tmp/opam-1225150-676d95/ocaml-5.1.1/asmcomp /tmp/opam-1225150-676d95/ocaml-5.1.1/boot
        /tmp/opam-1225150-676d95/ocaml-5.1.1/build-aux /tmp/opam-1225150-676d95/ocaml-5.1.1/bytecomp /tmp/opam-1225150-676d95/ocaml-5.1.1/compilerlibs
        /tmp/opam-1225150-676d95/ocaml-5.1.1/configure /tmp/opam-1225150-676d95/ocaml-5.1.1/configure.ac /tmp/opam-1225150-676d95/ocaml-5.1.1/debugger
        /tmp/opam-1225150-676d95/ocaml-5.1.1/driver /tmp/opam-1225150-676d95/ocaml-5.1.1/dune /tmp/opam-1225150-676d95/ocaml-5.1.1/dune-project
        /tmp/opam-1225150-676d95/ocaml-5.1.1/file_formats /tmp/opam-1225150-676d95/ocaml-5.1.1/flexdll /tmp/opam-1225150-676d95/ocaml-5.1.1/lambda
        /tmp/opam-1225150-676d95/ocaml-5.1.1/lex /tmp/opam-1225150-676d95/ocaml-5.1.1/man /tmp/opam-1225150-676d95/ocaml-5.1.1/manual
        /tmp/opam-1225150-676d95/ocaml-5.1.1/middle_end /tmp/opam-1225150-676d95/ocaml-5.1.1/ocaml-variants.opam
        /tmp/opam-1225150-676d95/ocaml-5.1.1/ocamldoc /tmp/opam-1225150-676d95/ocaml-5.1.1/ocamltest /tmp/opam-1225150-676d95/ocaml-5.1.1/otherlibs
        /tmp/opam-1225150-676d95/ocaml-5.1.1/parsing /tmp/opam-1225150-676d95/ocaml-5.1.1/release-info /tmp/opam-1225150-676d95/ocaml-5.1.1/runtime
        /tmp/opam-1225150-676d95/ocaml-5.1.1/stdlib /tmp/opam-1225150-676d95/ocaml-5.1.1/testsuite /tmp/opam-1225150-676d95/ocaml-5.1.1/tools
        /tmp/opam-1225150-676d95/ocaml-5.1.1/toplevel /tmp/opam-1225150-676d95/ocaml-5.1.1/typing /tmp/opam-1225150-676d95/ocaml-5.1.1/utils
        /tmp/opam-1225150-676d95/ocaml-5.1.1/yacc /mnt/r11921a02/DS920/.opam/default/.opam-switch/sources/ocaml-base-compiler.5.1.1" exited with code 1

#=== ERROR while fetching sources for ocaml-base-compiler.5.1.1 ===============#
OpamSolution.Fetch_fail("\027[33m#\027[0m \027[33mpath\027[0m        ~\n\027[33m#\027[0m \027[33mcommand\027[0m     /usr/bin/cp -PRp /tmp/opam-1225150-676d95/ocaml-5.1.1/.depend /tmp/opam-1225150-676d95/ocaml-5.1.1/.depend.menhir /tmp/opam-1225150-676d95/ocaml-5.1.1/.gitattributes /tmp/opam-1225150-676d95/ocaml-5.1.1/.github /tmp/opam-1225150-676d95/ocaml-5.1.1/.gitignore /tmp/opam-1225150-676d95/ocaml-5.1.1/.gitmodules /tmp/opam-1225150-676d95/ocaml-5.1.1/.mailmap /tmp/opam-1225150-676d95/ocaml-5.1.1/.ocp-indent /tmp/opam-1225150-676d95/ocaml-5.1.1/BOOTSTRAP.adoc /tmp/opam-1225150-676d95/ocaml-5.1.1/CODE_OF_CONDUCT.md /tmp/opam-1225150-676d95/ocaml-5.1.1/CONTRIBUTING.md /tmp/opam-1225150-676d95/ocaml-5.1.1/Changes /tmp/opam-1225150-676d95/ocaml-5.1.1/HACKING.adoc /tmp/opam-1225150-676d95/ocaml-5.1.1/INSTALL.adoc /tmp/opam-1225150-676d95/ocaml-5.1.1/LICENSE /tmp/opam-1225150-676d95/ocaml-5.1.1/Makefile /tmp/opam-1225150-676d95/ocaml-5.1.1/Makefile.best_binaries /tmp/opam-1225150-676d95/ocaml-5.1.1/Makefile.build_config.in /tmp/opam-1225150-676d95/ocaml-5.1.1/Makefile.common /tmp/opam-1225150-676d95/ocaml-5.1.1/Makefile.config.in /tmp/opam-1225150-676d95/ocaml-5.1.1/Makefile.config_if_required /tmp/opam-1225150-676d95/ocaml-5.1.1/Makefile.dev /tmp/opam-1225150-676d95/ocaml-5.1.1/Makefile.menhir /tmp/opam-1225150-676d95/ocaml-5.1.1/README.adoc /tmp/opam-1225150-676d95/ocaml-5.1.1/README.win32.adoc /tmp/opam-1225150-676d95/ocaml-5.1.1/VERSION /tmp/opam-1225150-676d95/ocaml-5.1.1/aclocal.m4 /tmp/opam-1225150-676d95/ocaml-5.1.1/api_docgen /tmp/opam-1225150-676d95/ocaml-5.1.1/appveyor.yml /tmp/opam-1225150-676d95/ocaml-5.1.1/asmcomp /tmp/opam-1225150-676d95/ocaml-5.1.1/boot /tmp/opam-1225150-676d95/ocaml-5.1.1/build-aux /tmp/opam-1225150-676d95/ocaml-5.1.1/bytecomp /tmp/opam-1225150-676d95/ocaml-5.1.1/compilerlibs /tmp/opam-1225150-676d95/ocaml-5.1.1/configure /tmp/opam-1225150-676d95/ocaml-5.1.1/configure.ac /tmp/opam-1225150-676d95/ocaml-5.1.1/debugger /tmp/opam-1225150-676d95/ocaml-5.1.1/driver /tmp/opam-1225150-676d95/ocaml-5.1.1/dune /tmp/opam-1225150-676d95/ocaml-5.1.1/dune-project /tmp/opam-1225150-676d95/ocaml-5.1.1/file_formats /tmp/opam-1225150-676d95/ocaml-5.1.1/flexdll /tmp/opam-1225150-676d95/ocaml-5.1.1/lambda /tmp/opam-1225150-676d95/ocaml-5.1.1/lex /tmp/opam-1225150-676d95/ocaml-5.1.1/man /tmp/opam-1225150-676d95/ocaml-5.1.1/manual /tmp/opam-1225150-676d95/ocaml-5.1.1/middle_end /tmp/opam-1225150-676d95/ocaml-5.1.1/ocaml-variants.opam /tmp/opam-1225150-676d95/ocaml-5.1.1/ocamldoc /tmp/opam-1225150-676d95/ocaml-5.1.1/ocamltest /tmp/opam-1225150-676d95/ocaml-5.1.1/otherlibs /tmp/opam-1225150-676d95/ocaml-5.1.1/parsing /tmp/opam-1225150-676d95/ocaml-5.1.1/release-info /tmp/opam-1225150-676d95/ocaml-5.1.1/runtime /tmp/opam-1225150-676d95/ocaml-5.1.1/stdlib /tmp/opam-1225150-676d95/ocaml-5.1.1/testsuite /tmp/opam-1225150-676d95/ocaml-5.1.1/tools /tmp/opam-1225150-676d95/ocaml-5.1.1/toplevel /tmp/opam-1225150-676d95/ocaml-5.1.1/typing /tmp/opam-1225150-676d95/ocaml-5.1.1/utils /tmp/opam-1225150-676d95/ocaml-5.1.1/yacc /mnt/r11921a02/DS920/.opam/default/.opam-switch/sources/ocaml-base-compiler.5.1.1\n\027[33m#\027[0m \027[33mexit-code\027[0m   1\n\027[33m#\027[0m \027[33menv-file\027[0m    /tmp/opam-r11a02-1225150/log-1225150-9a77db.env\n\027[33m#\027[0m \027[33moutput-file\027[0m /tmp/opam-r11a02-1225150/log-1225150-9a77db.out\n\027[33m### output ###\n\027[0m\027[33m# \027[0m[...]\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/default/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc/lalr.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/default/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc/lr0.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/default/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc/main.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/default/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc/mkpar.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/default/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc/output.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/default/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc/reader.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/default/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc/skeleton.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/default/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc/symtab.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/default/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc/verbose.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/default/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc/warshall.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/default/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc/wstr.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/default/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc\226\128\153: Operation not permitted\n")


<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
β”Œβ”€ The following actions failed
β”‚ ⬇ fetch ocaml-base-compiler 5.1.1
└─ 
β”Œβ”€ The following changes have been performed (the rest was aborted)
β”‚ βˆ— install base-bigarray         base
β”‚ βˆ— install base-threads          base
β”‚ βˆ— install base-unix             base
β”‚ βˆ— install ocaml-options-vanilla 1
└─ 
# Run eval $(opam env --switch=default) to update the current shell environment
Switch initialisation failed: clean up? ('n' will leave the switch partially installed) [Y/n] y
rm: cannot remove '/mnt/r11921a02/DS920/.opam/default/.opam-switch': Directory not empty
[NOTE] Opam has been initialised, but the initial switch creation failed.
       Use 'opam switch create <compiler>' to get started.

I followed the suggestion that use the command β€˜opam switch create ’ and do opam switch create 4.05.0 but the same problem still ocurred.

Lab30902% opam switch create 4.05.0     

<><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><><><>
Switch invariant: ["ocaml-base-compiler" {= "4.05.0"} | "ocaml-system" {= "4.05.0"}]

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
βˆ— installed base-bigarray.base
βˆ— installed base-threads.base
βˆ— installed base-unix.base
[ERROR] Failed to get sources of ocaml-base-compiler.4.05.0: "/usr/bin/cp -PRp /tmp/opam-1228056-de128a/ocaml-4.05.0/.depend
        /tmp/opam-1228056-de128a/ocaml-4.05.0/.gitattributes /tmp/opam-1228056-de128a/ocaml-4.05.0/.gitignore
        /tmp/opam-1228056-de128a/ocaml-4.05.0/.gitmodules /tmp/opam-1228056-de128a/ocaml-4.05.0/.mailmap /tmp/opam-1228056-de128a/ocaml-4.05.0/.merlin
        /tmp/opam-1228056-de128a/ocaml-4.05.0/.ocp-indent /tmp/opam-1228056-de128a/ocaml-4.05.0/.travis-ci.sh
        /tmp/opam-1228056-de128a/ocaml-4.05.0/.travis.yml /tmp/opam-1228056-de128a/ocaml-4.05.0/CONTRIBUTING.md
        /tmp/opam-1228056-de128a/ocaml-4.05.0/Changes /tmp/opam-1228056-de128a/ocaml-4.05.0/HACKING.adoc
        /tmp/opam-1228056-de128a/ocaml-4.05.0/INSTALL.adoc /tmp/opam-1228056-de128a/ocaml-4.05.0/LICENSE /tmp/opam-1228056-de128a/ocaml-4.05.0/Makefile
        /tmp/opam-1228056-de128a/ocaml-4.05.0/Makefile.nt /tmp/opam-1228056-de128a/ocaml-4.05.0/Makefile.tools
        /tmp/opam-1228056-de128a/ocaml-4.05.0/README.adoc /tmp/opam-1228056-de128a/ocaml-4.05.0/README.win32.adoc
        /tmp/opam-1228056-de128a/ocaml-4.05.0/VERSION /tmp/opam-1228056-de128a/ocaml-4.05.0/appveyor.yml
        /tmp/opam-1228056-de128a/ocaml-4.05.0/appveyor_build.sh /tmp/opam-1228056-de128a/ocaml-4.05.0/asmcomp
        /tmp/opam-1228056-de128a/ocaml-4.05.0/asmrun /tmp/opam-1228056-de128a/ocaml-4.05.0/boot /tmp/opam-1228056-de128a/ocaml-4.05.0/bytecomp
        /tmp/opam-1228056-de128a/ocaml-4.05.0/byterun /tmp/opam-1228056-de128a/ocaml-4.05.0/compilerlibs /tmp/opam-1228056-de128a/ocaml-4.05.0/config
        /tmp/opam-1228056-de128a/ocaml-4.05.0/configure /tmp/opam-1228056-de128a/ocaml-4.05.0/debugger /tmp/opam-1228056-de128a/ocaml-4.05.0/driver
        /tmp/opam-1228056-de128a/ocaml-4.05.0/emacs /tmp/opam-1228056-de128a/ocaml-4.05.0/experimental /tmp/opam-1228056-de128a/ocaml-4.05.0/flexdll
        /tmp/opam-1228056-de128a/ocaml-4.05.0/lex /tmp/opam-1228056-de128a/ocaml-4.05.0/man /tmp/opam-1228056-de128a/ocaml-4.05.0/manual
        /tmp/opam-1228056-de128a/ocaml-4.05.0/middle_end /tmp/opam-1228056-de128a/ocaml-4.05.0/ocamldoc /tmp/opam-1228056-de128a/ocaml-4.05.0/otherlibs
        /tmp/opam-1228056-de128a/ocaml-4.05.0/parsing /tmp/opam-1228056-de128a/ocaml-4.05.0/stdlib /tmp/opam-1228056-de128a/ocaml-4.05.0/testsuite
        /tmp/opam-1228056-de128a/ocaml-4.05.0/tools /tmp/opam-1228056-de128a/ocaml-4.05.0/toplevel /tmp/opam-1228056-de128a/ocaml-4.05.0/typing
        /tmp/opam-1228056-de128a/ocaml-4.05.0/utils /tmp/opam-1228056-de128a/ocaml-4.05.0/yacc
        /mnt/r11921a02/DS920/.opam/4.05.0/.opam-switch/sources/ocaml-base-compiler.4.05.0" exited with code 1

#=== ERROR while fetching sources for ocaml-base-compiler.4.05.0 ==============#
OpamSolution.Fetch_fail("\027[33m#\027[0m \027[33mpath\027[0m        ~\n\027[33m#\027[0m \027[33mcommand\027[0m     /usr/bin/cp -PRp /tmp/opam-1228056-de128a/ocaml-4.05.0/.depend /tmp/opam-1228056-de128a/ocaml-4.05.0/.gitattributes /tmp/opam-1228056-de128a/ocaml-4.05.0/.gitignore /tmp/opam-1228056-de128a/ocaml-4.05.0/.gitmodules /tmp/opam-1228056-de128a/ocaml-4.05.0/.mailmap /tmp/opam-1228056-de128a/ocaml-4.05.0/.merlin /tmp/opam-1228056-de128a/ocaml-4.05.0/.ocp-indent /tmp/opam-1228056-de128a/ocaml-4.05.0/.travis-ci.sh /tmp/opam-1228056-de128a/ocaml-4.05.0/.travis.yml /tmp/opam-1228056-de128a/ocaml-4.05.0/CONTRIBUTING.md /tmp/opam-1228056-de128a/ocaml-4.05.0/Changes /tmp/opam-1228056-de128a/ocaml-4.05.0/HACKING.adoc /tmp/opam-1228056-de128a/ocaml-4.05.0/INSTALL.adoc /tmp/opam-1228056-de128a/ocaml-4.05.0/LICENSE /tmp/opam-1228056-de128a/ocaml-4.05.0/Makefile /tmp/opam-1228056-de128a/ocaml-4.05.0/Makefile.nt /tmp/opam-1228056-de128a/ocaml-4.05.0/Makefile.tools /tmp/opam-1228056-de128a/ocaml-4.05.0/README.adoc /tmp/opam-1228056-de128a/ocaml-4.05.0/README.win32.adoc /tmp/opam-1228056-de128a/ocaml-4.05.0/VERSION /tmp/opam-1228056-de128a/ocaml-4.05.0/appveyor.yml /tmp/opam-1228056-de128a/ocaml-4.05.0/appveyor_build.sh /tmp/opam-1228056-de128a/ocaml-4.05.0/asmcomp /tmp/opam-1228056-de128a/ocaml-4.05.0/asmrun /tmp/opam-1228056-de128a/ocaml-4.05.0/boot /tmp/opam-1228056-de128a/ocaml-4.05.0/bytecomp /tmp/opam-1228056-de128a/ocaml-4.05.0/byterun /tmp/opam-1228056-de128a/ocaml-4.05.0/compilerlibs /tmp/opam-1228056-de128a/ocaml-4.05.0/config /tmp/opam-1228056-de128a/ocaml-4.05.0/configure /tmp/opam-1228056-de128a/ocaml-4.05.0/debugger /tmp/opam-1228056-de128a/ocaml-4.05.0/driver /tmp/opam-1228056-de128a/ocaml-4.05.0/emacs /tmp/opam-1228056-de128a/ocaml-4.05.0/experimental /tmp/opam-1228056-de128a/ocaml-4.05.0/flexdll /tmp/opam-1228056-de128a/ocaml-4.05.0/lex /tmp/opam-1228056-de128a/ocaml-4.05.0/man /tmp/opam-1228056-de128a/ocaml-4.05.0/manual /tmp/opam-1228056-de128a/ocaml-4.05.0/middle_end /tmp/opam-1228056-de128a/ocaml-4.05.0/ocamldoc /tmp/opam-1228056-de128a/ocaml-4.05.0/otherlibs /tmp/opam-1228056-de128a/ocaml-4.05.0/parsing /tmp/opam-1228056-de128a/ocaml-4.05.0/stdlib /tmp/opam-1228056-de128a/ocaml-4.05.0/testsuite /tmp/opam-1228056-de128a/ocaml-4.05.0/tools /tmp/opam-1228056-de128a/ocaml-4.05.0/toplevel /tmp/opam-1228056-de128a/ocaml-4.05.0/typing /tmp/opam-1228056-de128a/ocaml-4.05.0/utils /tmp/opam-1228056-de128a/ocaml-4.05.0/yacc /mnt/r11921a02/DS920/.opam/4.05.0/.opam-switch/sources/ocaml-base-compiler.4.05.0\n\027[33m#\027[0m \027[33mexit-code\027[0m   1\n\027[33m#\027[0m \027[33menv-file\027[0m    ~/.opam/log/log-1228056-95ffb5.env\n\027[33m#\027[0m \027[33moutput-file\027[0m ~/.opam/log/log-1228056-95ffb5.out\n\027[33m### output ###\n\027[0m\027[33m# \027[0m[...]\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/4.05.0/.opam-switch/sources/ocaml-base-compiler.4.05.0/yacc/error.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/4.05.0/.opam-switch/sources/ocaml-base-compiler.4.05.0/yacc/lalr.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/4.05.0/.opam-switch/sources/ocaml-base-compiler.4.05.0/yacc/lr0.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/4.05.0/.opam-switch/sources/ocaml-base-compiler.4.05.0/yacc/main.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/4.05.0/.opam-switch/sources/ocaml-base-compiler.4.05.0/yacc/mkpar.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/4.05.0/.opam-switch/sources/ocaml-base-compiler.4.05.0/yacc/output.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/4.05.0/.opam-switch/sources/ocaml-base-compiler.4.05.0/yacc/reader.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/4.05.0/.opam-switch/sources/ocaml-base-compiler.4.05.0/yacc/skeleton.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/4.05.0/.opam-switch/sources/ocaml-base-compiler.4.05.0/yacc/symtab.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/4.05.0/.opam-switch/sources/ocaml-base-compiler.4.05.0/yacc/verbose.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/4.05.0/.opam-switch/sources/ocaml-base-compiler.4.05.0/yacc/warshall.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/4.05.0/.opam-switch/sources/ocaml-base-compiler.4.05.0/yacc\226\128\153: Operation not permitted\n")


<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
β”Œβ”€ The following actions failed
β”‚ ⬇ fetch ocaml-base-compiler 4.05.0
└─ 
β”Œβ”€ The following changes have been performed (the rest was aborted)
β”‚ βˆ— install base-bigarray base
β”‚ βˆ— install base-threads  base
β”‚ βˆ— install base-unix     base
└─ 
# Run eval $(opam env --switch=4.05.0) to update the current shell environment
Switch initialisation failed: clean up? ('n' will leave the switch partially installed) [Y/n] Y

rm: cannot remove '/mnt/r11921a02/DS920/.opam/4.05.0/.opam-switch': Directory not empty

In the post Creating an opam local switch with a space in the current directory fails, it seems like old version sometimes has bugs and use a new one might work, so I try the latest one with opam switch create 5.1.1. But the same problem still exists:

Lab30902% opam switch create 5.1.1 

<><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><><><>
Switch invariant: ["ocaml-base-compiler" {= "5.1.1"} | "ocaml-system" {= "5.1.1"}]

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
βˆ— installed base-bigarray.base
βˆ— installed base-threads.base
βˆ— installed base-unix.base
βˆ— installed ocaml-options-vanilla.1
[ERROR] Failed to get sources of ocaml-base-compiler.5.1.1: "/usr/bin/cp -PRp /tmp/opam-1230741-91e2dd/ocaml-5.1.1/.depend
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/.depend.menhir /tmp/opam-1230741-91e2dd/ocaml-5.1.1/.gitattributes
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/.github /tmp/opam-1230741-91e2dd/ocaml-5.1.1/.gitignore /tmp/opam-1230741-91e2dd/ocaml-5.1.1/.gitmodules
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/.mailmap /tmp/opam-1230741-91e2dd/ocaml-5.1.1/.ocp-indent
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/BOOTSTRAP.adoc /tmp/opam-1230741-91e2dd/ocaml-5.1.1/CODE_OF_CONDUCT.md
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/CONTRIBUTING.md /tmp/opam-1230741-91e2dd/ocaml-5.1.1/Changes
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/HACKING.adoc /tmp/opam-1230741-91e2dd/ocaml-5.1.1/INSTALL.adoc /tmp/opam-1230741-91e2dd/ocaml-5.1.1/LICENSE
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/Makefile /tmp/opam-1230741-91e2dd/ocaml-5.1.1/Makefile.best_binaries
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/Makefile.build_config.in /tmp/opam-1230741-91e2dd/ocaml-5.1.1/Makefile.common
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/Makefile.config.in /tmp/opam-1230741-91e2dd/ocaml-5.1.1/Makefile.config_if_required
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/Makefile.dev /tmp/opam-1230741-91e2dd/ocaml-5.1.1/Makefile.menhir
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/README.adoc /tmp/opam-1230741-91e2dd/ocaml-5.1.1/README.win32.adoc
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/VERSION /tmp/opam-1230741-91e2dd/ocaml-5.1.1/aclocal.m4 /tmp/opam-1230741-91e2dd/ocaml-5.1.1/api_docgen
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/appveyor.yml /tmp/opam-1230741-91e2dd/ocaml-5.1.1/asmcomp /tmp/opam-1230741-91e2dd/ocaml-5.1.1/boot
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/build-aux /tmp/opam-1230741-91e2dd/ocaml-5.1.1/bytecomp /tmp/opam-1230741-91e2dd/ocaml-5.1.1/compilerlibs
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/configure /tmp/opam-1230741-91e2dd/ocaml-5.1.1/configure.ac /tmp/opam-1230741-91e2dd/ocaml-5.1.1/debugger
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/driver /tmp/opam-1230741-91e2dd/ocaml-5.1.1/dune /tmp/opam-1230741-91e2dd/ocaml-5.1.1/dune-project
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/file_formats /tmp/opam-1230741-91e2dd/ocaml-5.1.1/flexdll /tmp/opam-1230741-91e2dd/ocaml-5.1.1/lambda
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/lex /tmp/opam-1230741-91e2dd/ocaml-5.1.1/man /tmp/opam-1230741-91e2dd/ocaml-5.1.1/manual
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/middle_end /tmp/opam-1230741-91e2dd/ocaml-5.1.1/ocaml-variants.opam
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/ocamldoc /tmp/opam-1230741-91e2dd/ocaml-5.1.1/ocamltest /tmp/opam-1230741-91e2dd/ocaml-5.1.1/otherlibs
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/parsing /tmp/opam-1230741-91e2dd/ocaml-5.1.1/release-info /tmp/opam-1230741-91e2dd/ocaml-5.1.1/runtime
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/stdlib /tmp/opam-1230741-91e2dd/ocaml-5.1.1/testsuite /tmp/opam-1230741-91e2dd/ocaml-5.1.1/tools
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/toplevel /tmp/opam-1230741-91e2dd/ocaml-5.1.1/typing /tmp/opam-1230741-91e2dd/ocaml-5.1.1/utils
        /tmp/opam-1230741-91e2dd/ocaml-5.1.1/yacc /mnt/r11921a02/DS920/.opam/5.1.1/.opam-switch/sources/ocaml-base-compiler.5.1.1" exited with code 1

#=== ERROR while fetching sources for ocaml-base-compiler.5.1.1 ===============#
OpamSolution.Fetch_fail("\027[33m#\027[0m \027[33mpath\027[0m        ~\n\027[33m#\027[0m \027[33mcommand\027[0m     /usr/bin/cp -PRp /tmp/opam-1230741-91e2dd/ocaml-5.1.1/.depend /tmp/opam-1230741-91e2dd/ocaml-5.1.1/.depend.menhir /tmp/opam-1230741-91e2dd/ocaml-5.1.1/.gitattributes /tmp/opam-1230741-91e2dd/ocaml-5.1.1/.github /tmp/opam-1230741-91e2dd/ocaml-5.1.1/.gitignore /tmp/opam-1230741-91e2dd/ocaml-5.1.1/.gitmodules /tmp/opam-1230741-91e2dd/ocaml-5.1.1/.mailmap /tmp/opam-1230741-91e2dd/ocaml-5.1.1/.ocp-indent /tmp/opam-1230741-91e2dd/ocaml-5.1.1/BOOTSTRAP.adoc /tmp/opam-1230741-91e2dd/ocaml-5.1.1/CODE_OF_CONDUCT.md /tmp/opam-1230741-91e2dd/ocaml-5.1.1/CONTRIBUTING.md /tmp/opam-1230741-91e2dd/ocaml-5.1.1/Changes /tmp/opam-1230741-91e2dd/ocaml-5.1.1/HACKING.adoc /tmp/opam-1230741-91e2dd/ocaml-5.1.1/INSTALL.adoc /tmp/opam-1230741-91e2dd/ocaml-5.1.1/LICENSE /tmp/opam-1230741-91e2dd/ocaml-5.1.1/Makefile /tmp/opam-1230741-91e2dd/ocaml-5.1.1/Makefile.best_binaries /tmp/opam-1230741-91e2dd/ocaml-5.1.1/Makefile.build_config.in /tmp/opam-1230741-91e2dd/ocaml-5.1.1/Makefile.common /tmp/opam-1230741-91e2dd/ocaml-5.1.1/Makefile.config.in /tmp/opam-1230741-91e2dd/ocaml-5.1.1/Makefile.config_if_required /tmp/opam-1230741-91e2dd/ocaml-5.1.1/Makefile.dev /tmp/opam-1230741-91e2dd/ocaml-5.1.1/Makefile.menhir /tmp/opam-1230741-91e2dd/ocaml-5.1.1/README.adoc /tmp/opam-1230741-91e2dd/ocaml-5.1.1/README.win32.adoc /tmp/opam-1230741-91e2dd/ocaml-5.1.1/VERSION /tmp/opam-1230741-91e2dd/ocaml-5.1.1/aclocal.m4 /tmp/opam-1230741-91e2dd/ocaml-5.1.1/api_docgen /tmp/opam-1230741-91e2dd/ocaml-5.1.1/appveyor.yml /tmp/opam-1230741-91e2dd/ocaml-5.1.1/asmcomp /tmp/opam-1230741-91e2dd/ocaml-5.1.1/boot /tmp/opam-1230741-91e2dd/ocaml-5.1.1/build-aux /tmp/opam-1230741-91e2dd/ocaml-5.1.1/bytecomp /tmp/opam-1230741-91e2dd/ocaml-5.1.1/compilerlibs /tmp/opam-1230741-91e2dd/ocaml-5.1.1/configure /tmp/opam-1230741-91e2dd/ocaml-5.1.1/configure.ac /tmp/opam-1230741-91e2dd/ocaml-5.1.1/debugger /tmp/opam-1230741-91e2dd/ocaml-5.1.1/driver /tmp/opam-1230741-91e2dd/ocaml-5.1.1/dune /tmp/opam-1230741-91e2dd/ocaml-5.1.1/dune-project /tmp/opam-1230741-91e2dd/ocaml-5.1.1/file_formats /tmp/opam-1230741-91e2dd/ocaml-5.1.1/flexdll /tmp/opam-1230741-91e2dd/ocaml-5.1.1/lambda /tmp/opam-1230741-91e2dd/ocaml-5.1.1/lex /tmp/opam-1230741-91e2dd/ocaml-5.1.1/man /tmp/opam-1230741-91e2dd/ocaml-5.1.1/manual /tmp/opam-1230741-91e2dd/ocaml-5.1.1/middle_end /tmp/opam-1230741-91e2dd/ocaml-5.1.1/ocaml-variants.opam /tmp/opam-1230741-91e2dd/ocaml-5.1.1/ocamldoc /tmp/opam-1230741-91e2dd/ocaml-5.1.1/ocamltest /tmp/opam-1230741-91e2dd/ocaml-5.1.1/otherlibs /tmp/opam-1230741-91e2dd/ocaml-5.1.1/parsing /tmp/opam-1230741-91e2dd/ocaml-5.1.1/release-info /tmp/opam-1230741-91e2dd/ocaml-5.1.1/runtime /tmp/opam-1230741-91e2dd/ocaml-5.1.1/stdlib /tmp/opam-1230741-91e2dd/ocaml-5.1.1/testsuite /tmp/opam-1230741-91e2dd/ocaml-5.1.1/tools /tmp/opam-1230741-91e2dd/ocaml-5.1.1/toplevel /tmp/opam-1230741-91e2dd/ocaml-5.1.1/typing /tmp/opam-1230741-91e2dd/ocaml-5.1.1/utils /tmp/opam-1230741-91e2dd/ocaml-5.1.1/yacc /mnt/r11921a02/DS920/.opam/5.1.1/.opam-switch/sources/ocaml-base-compiler.5.1.1\n\027[33m#\027[0m \027[33mexit-code\027[0m   1\n\027[33m#\027[0m \027[33menv-file\027[0m    ~/.opam/log/log-1230741-22ddf8.env\n\027[33m#\027[0m \027[33moutput-file\027[0m ~/.opam/log/log-1230741-22ddf8.out\n\027[33m### output ###\n\027[0m\027[33m# \027[0m[...]\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/5.1.1/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc/lalr.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/5.1.1/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc/lr0.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/5.1.1/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc/main.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/5.1.1/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc/mkpar.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/5.1.1/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc/output.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/5.1.1/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc/reader.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/5.1.1/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc/skeleton.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/5.1.1/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc/symtab.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/5.1.1/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc/verbose.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/5.1.1/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc/warshall.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/5.1.1/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc/wstr.c\226\128\153: Operation not permitted\n\027[33m# \027[0m/usr/bin/cp: preserving permissions for \226\128\152/mnt/r11921a02/DS920/.opam/5.1.1/.opam-switch/sources/ocaml-base-compiler.5.1.1/yacc\226\128\153: Operation not permitted\n")


<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
β”Œβ”€ The following actions failed
β”‚ ⬇ fetch ocaml-base-compiler 5.1.1
└─ 
β”Œβ”€ The following changes have been performed (the rest was aborted)
β”‚ βˆ— install base-bigarray         base
β”‚ βˆ— install base-threads          base
β”‚ βˆ— install base-unix             base
β”‚ βˆ— install ocaml-options-vanilla 1
└─ 
# Run eval $(opam env --switch=5.1.1) to update the current shell environment
Switch initialisation failed: clean up? ('n' will leave the switch partially installed) [Y/n] Y

rm: cannot remove '/mnt/r11921a02/DS920/.opam/5.1.1/.opam-switch': Directory not empty
Lab30902% 

Information about the environment:

Lab30902% lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.4 LTS
Release:        20.04
Codename:       focal

I have no idea how to fix this. Did anyone encounter the same problem before or have any idea what might be the problem?

It looks like it is failing on what should be a trivial operation - copy a bunch of files out of /tmp/ into your home directory. In your case, that seems to be /mnt/r11921a02/DS920/ which is unusual. Could there be some permission/selinux/apparmor rule interfering?

1 Like

The home directory path is /mnt/r11921a02/DS920/ because the server uses NAS. Considering this might be the problem, I tried to use another environment which isn’t using NAS, and it works! Thank you so much for pointing out the unusual path!

Aha! Probably something to do with not being able to set the correct permissions/owner then. I only noticed because I’ve had a similar problem in the past and it took me many, many hours to figure out the underlying problem.

1 Like