oh-my-fish: Failed install on Windows Subsystem Linux

Hi,

I’m trying to install omf and getting some errors…

scott@DESKTOP-588NABH /m/c/U/spenc> sudo curl -L https://get.oh-my.fish | fish
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   194  100   194    0     0    309      0 --:--:-- --:--:-- --:--:--   308
100 16622  100 16622    0     0  11593      0  0:00:01  0:00:01 --:--:-- 41245
Existing installation detected at /home/scott/.local/share/omf
Would you like to remove the existing installation? (y/N): <W> fish: No TTY for interactive shell (tcgetpgrp failed)
setpgid: Inappropriate ioctl for device
scott@DESKTOP-588NABH /m/c/U/spenc> rm -rf /home/scott/.local/share/omf/
scott@DESKTOP-588NABH /m/c/U/spenc> sudo curl -L https://get.oh-my.fish | fish
source: Error encountered while sourcing file “/home/scott/.local/share/omf/init.fish”:
source: No such file or directory
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   194  100   194    0     0    431      0 --:--:-- --:--:-- --:--:--   432
100 16622  100 16622    0     0  18271      0 --:--:-- --:--:-- --:--:-- 18271
Installing Oh My Fish to /home/scott/.local/share/omf...
Using release channel "stable".
Cloning master from https://github.com/oh-my-fish/oh-my-fish.git...
Setting up Oh My Fish configuration...
Updating https://github.com/oh-my-fish/packages-main master... fatal: could not create leading directories of '/home/scott/.cache/omf/https___github.com_oh-my-fish_packages-main_master': Permission denied
Error
Install aborted: Error installing plugins

Oh My Fish installation failed.

If you think that it's a bug, please open an
issue with the complete installation log here:

http://github.com/oh-my-fish/oh-my-fish/issues

Here’s some more information:

scott@DESKTOP-588NABH /m/c/U/spenc> stat ~/.cache
  File: '/home/scott/.cache'
  Size: 512             Blocks: 0          IO Block: 512    directory
Device: 2h/2d   Inode: 1125899909392993  Links: 0
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2017-10-14 06:26:35.290976000 +0100
Modify: 2017-10-14 06:26:35.291424900 +0100
Change: 2017-10-14 06:26:35.291424900 +0100
 Birth: -

I’m not sure if it’s permissions, I mean it looks like if from the error message 🙃

Can anyone give guidance on what I need to do to change permissions?

Thanks

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 19 (8 by maintainers)

Most upvoted comments

OK, so I think now we have all the puzzle pieces.

You do have a permissions issue. Notice in your first post that ~/.cache has these permissions:

Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)

Meaning that only root can create and write to files in it. You probably ran something with sudo earlier, that created the ~/.cache folder with root as the owner. Then while you thought that you were running the installer as superuser, you were only downloading the installer script as superuser and then ran fish as the normal user. This combination lead to the fish installer running as normal user and unable to access ~/.cache, to which it must have write permissions.

So to resolve, I suggest the following steps:

  1. Manual uninstall:
rm ~/.config/fish/conf.d/omf.fish
exec fish
rm -rf ~/.local/share/omf
  1. Optional: backup the ~/.cache folder. There shouldn’t be anything critical in the cache folder, but to be certain that you don’t lose anything important:
sudo mv /home/scott/.cache{,.backup}

Tip: in fish, bla{,.backup} expands to bla bla.backup. 3. If you skipped step 2, remove the .cache folder:

sudo rm -rf /home/scott/.cache
  1. Run the installer again, no sudo this time:
curl -L https://get.oh-my.fish | fish
  1. Let us know how if it works or not, please.

General tip: try to use sudo only when you’re certain that it’s necessary or when you tried without it and it failed with permission errors.

Thanks for the pointers @oranja

image

Looks ok now 👍

Please feel free to close this issue

No problem, just doing some periodic issue grooming. 😄

Always recommended to run with fish, but bash should be fine too IIRC

On Sun, 15 Oct 2017, 12:15 Scott Spence, notifications@github.com wrote:

Run the installer again, no sudo this time:

curl -L https://get.oh-my.fish | fish

Run from fish or bash?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/oh-my-fish/oh-my-fish/issues/566#issuecomment-336697151, or mute the thread https://github.com/notifications/unsubscribe-auth/AApdEPjYplAC5uSZlL5lxELo8utxJb9tks5ssc1JgaJpZM4P5ce- .