1

I have been using the Windows Subsytem for Linux for SPIN(Promela) for quite some time. However, without any changes in the setup, suddenly since 28 Oct 2019, I am getting error 'Permission denied' error for '/usr/bin/spin'. Other commands in the same location '/usr/bin/..' work just normally like earlier. I verified for clear, gcc -v, yacc -v and sudo apt install gcc.

The command location in WSL is under directory 'rootfs', which cannot be accessed using 'cd' or 'chmod'. So I do not know if it actually is a rights problem, because other commands in the same location work fine.

What is weird is that 'sudo apt install spin' says "spin is already the newest version (6.4.6+dfsg-2)." But 'spin -v' says "-bash: /usr/bin/spin: Permission denied"

Sneha Sahu
  • 33
  • 8
  • One option is to *"install"* the executable of `nano` in a a path owned by your user-account, and then update the `PATH` environment variable to include also the new path. If a `.bashrc` is available on the *Windows Substystem for Linux*, then you can update `PATH` within it. – Patrick Trentin Oct 28 '19 at 12:58
  • @PatrickTrentin nano is already installed and the directory '.../rootfs/bin' also exists in 'PATH'. '.bashsrc' also exists but fetches info from windows ENV variables. So WSL has that info. – Sneha Sahu Oct 29 '19 at 13:44
  • @SnehaSahu I meant `spin`, sorry. I understood that the issue is that the `spin` executable is correctly placed in a location included in the `PATH`, but the executable no longer has the right permission (or these are denied), and that `chmod` cannot be used within `/usr/bin`. That is why I proposed installing `spin` under a different path in which one can successfully use `chmod`. – Patrick Trentin Oct 29 '19 at 13:49
  • @PatrickTrentin Also what is weird is that 'sudo apt install spin' says "spin is already the newest version (6.4.6+dfsg-2)." But 'spin -v' says "-bash: /usr/bin/spin: Permission denied" – Sneha Sahu Oct 29 '19 at 13:50
  • @SnehaSahu have you tried the trivial solution, `sudo apt remove spin` and `sudo apt install spin`? – Patrick Trentin Oct 29 '19 at 13:53
  • @PatrickTrentin Yes, correct issue is with rights but only for spin and not other commands. Also the complete directory staring with 'rootfs' is secured. In my understanding to use spin with WSL it needs to go somewhere inside rootfs and not any other directory – Sneha Sahu Oct 29 '19 at 13:54
  • just tried it and again permission error - … Removing spin (6.4.6+dfsg-2) ... dpkg: error processing package spin (--remove): unable to securely remove '/usr/bin/spin': Permission denied E: Sub-process /usr/bin/dpkg returned an error code (1) – Sneha Sahu Oct 29 '19 at 13:57
  • There is no need to have `spin` under `/usr/bin`, actually. I keep it under `/opt/my_resources/spin` on my system. One can download, compile and run it locally. – Patrick Trentin Oct 29 '19 at 13:59
  • @PatrickTrentin, where is the /opt directory located ? - %systemroot%/AppData/Local/Packages/CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc/LocalState/rootfs/… or another place? – Sneha Sahu Oct 29 '19 at 14:05
  • First, I would try to download/compile/execute `spin` in a local directory (e.g. `$HOME`). – Patrick Trentin Oct 29 '19 at 14:07

1 Answers1

1

The trivial solution given by Patrick seemed to work. ;)

Since there was this permission denied error for the file in rootfs/usr/bin removal was also not possible. So I first manually deleted the file from the location, followed by sudo apt remove spin and then 'sudo apt install spin'.

Now spin seems to work just fine.

Sneha Sahu
  • 33
  • 8