Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed install on Windows Subsystem Linux #566

Closed
spences10 opened this issue Oct 14, 2017 · 19 comments
Closed

Failed install on Windows Subsystem Linux #566

spences10 opened this issue Oct 14, 2017 · 19 comments
Labels
installer Related to installer script windows Issues related to running on Windows

Comments

@spences10
Copy link

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

@oranja
Copy link
Contributor

oranja commented Oct 14, 2017

Hi @spences10,

Thanks for reporting, but we're going to need more details to start to investigate your situation.
Please include:

  • Your operating system build number.
  • Your fish version, and where you got it from? (fedora repository?
    homebrew? built from sources?)
  • Which terminal emulator you're using (and version)?
  • Any other detail that you think might be relevant to this issue. What's
    unique in your setup?

@spences10
Copy link
Author

Of course, apologies @oranja

Here's my system info:
image

Fish version fish, version 2.6.0 from Linuxbrew

Using Hyper v1.4.8

I'm using it in Windows Subsystem Linux

Thanks

@oranja
Copy link
Contributor

oranja commented Oct 14, 2017

Thanks @spences10,

Seems to me like we're seeing two issues at once here:

  1. As we've learned in dealing with Installing oh-my-fish on cygwin  #545, using *nix tools on Windows is tricky. If you have "Git for Windows" installed, and that's what the WSL sees, Git can get confused since it's not really Windows that it's running under. Try to install a git that's built for WSL (should be simple as running sudo apt install git).
  2. The second issue comes from OMF's installer triggering some functionality that has been accidentally broken in fish 2.6.0. Not clear yet what's the core issue and what's the workaround, but if you're trying to reinstall OMF (even after a failed previous install attempt), there is a tip to try to manually uninstall it first and then try the installer again. We need to track Variant of the No TTY for interactive shell fish-shell/fish-shell#4178

@spences10
Copy link
Author

spences10 commented Oct 15, 2017

Thanks @oranja

  1. I'm on the latest git with Linux here:
whereis git
git: /usr/bin/git /mnt/c/Program Files/Git/cmd/git.exe /usr/share/man/man1/git.1.gz
  1. Is there guidance on how to manually uninstall OMF? I was just deleting /home/scott/.local/share/omf/ and trying asgain 🙃

@oranja
Copy link
Contributor

oranja commented Oct 15, 2017

The last step in a manual uninstall is indeed rm -rf ~/.local/share/omf.
If a previous installation was successful, you should also rm ~/.config/fish/conf.d/omf.fish and reload fish (run exec fish).

@spences10
Copy link
Author

Thanks @oranja I was meant to update my last comment here stating that I have done that now 🙃

Tried another several times and still the same permission error.

image

@oranja
Copy link
Contributor

oranja commented Oct 15, 2017

Something I noticed just now, why sudo curl instead of a plain curl?
Is this some firewall policy that only allows privileged processes to access the Internet?
Otherwise, you should know that OMF is meant to be installed for a regular user and not for root. So no sudo is needed before curl nor fish. Also note that running sudo curl before piping (|) to fish will not run fish in superuser mode, only curl.

Not that I think this will solve the problem, but it's worth addressing.

@spences10
Copy link
Author

I was guessing using sudo would give the correct permissions for the install.

Trying stuff out 🤷‍♂️ 😄

@oranja
Copy link
Contributor

oranja commented Oct 15, 2017

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.

@spences10
Copy link
Author

This is great general advice, thanks @oranja 👍

I have literally just reinstalled Ubuntu again on my machine, Windows just decided that it didn't want that install to work anymore 🤷‍♂️ maybe because of my tendency to sudo all the things.

I'm going to have to install Linuxbrew again now (this time with no sudo) and install Fish from there and see how the install of OMF goes.

Thanks for your help 💯

@spences10
Copy link
Author

Run the installer again, no sudo this time:

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

Run from fish or bash?

@oranja
Copy link
Contributor

oranja commented Oct 15, 2017 via email

@spences10
Copy link
Author

Hmmm, 🤔

image

This was from a fresh install of Ubuntu as well, everything was setup from the installer, only thing I had installed was Linuxbrew (without sudo)

@oranja
Copy link
Contributor

oranja commented Oct 15, 2017

Did you remove the ~/.cache folder?

sudo rm -rf /home/scott/.cache

If it was recreated again using the same root permissions, it's very strange, but I suspect it just stayed there on your file system while you reinstalled Ubuntu.

@spences10
Copy link
Author

No I did not :face_palm:

I'll take a look later today, thanks again @oranja

@spences10
Copy link
Author

Thanks for the pointers @oranja

image

Looks ok now 👍

Please feel free to close this issue

@spences10
Copy link
Author

I've had three fresh installs now and had to follow this process each time, when I say fresh, I mean the last was straight after a complete device reset with all the drives wiped.

@spences10
Copy link
Author

@sagebind my apologies, yes this can be closed, I started using n-install instead of nvm and all my issues around permissions went away.

Sorry for not attending to this! 🙏

@sagebind
Copy link
Member

No problem, just doing some periodic issue grooming. 😄

@sagebind sagebind added installer Related to installer script windows Issues related to running on Windows labels Jan 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installer Related to installer script windows Issues related to running on Windows
Projects
None yet
Development

No branches or pull requests

3 participants