nix-portable icon indicating copy to clipboard operation
nix-portable copied to clipboard

rm: cannot remove '.nix-portable/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-something/foo/bar': Permission denied

Open ShamrockLee opened this issue 3 years ago • 3 comments

Reproduction step:

  1. Set NP_LOCATION on ram-based file system.
    NP_LOCATION="$TMPDIR" nix-portable bla bla bla
    
  2. rm -rf .nix-portable
    
  3. See many rm cannot remove '.nix-portable/store/...': permission denied error.

ShamrockLee avatar Feb 15 '22 13:02 ShamrockLee

@ShamrockLee Does running chmod -R 777 .nix-portable and then running rm -rf .nix-portable work for you?

Some directories in the nix store do not have the writable bit set; rm -f will delete "read only" files that are owned by your user but will not delete "read only" directories (afaik), hence the error. Because the folders are owned by your user you have permissions to run chmod.

rrbutani avatar Feb 15 '22 18:02 rrbutani

@rrbutani It works! Thanks a lot!

It would be helpful to document this as a "way to clean-up" and a workaround of #25.

ShamrockLee avatar Feb 16 '22 09:02 ShamrockLee