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

Installation fails on BSD #3367

Closed
WhyNotHugo opened this issue Dec 2, 2014 · 21 comments · Fixed by #3613
Closed

Installation fails on BSD #3367

WhyNotHugo opened this issue Dec 2, 2014 · 21 comments · Fixed by #3613

Comments

@WhyNotHugo
Copy link

The installation fails on OpenBSD. Maybe there's an assumption that sed is GNU sed?

$ curl -L http://install.ohmyz.sh | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   115  100   115    0     0    628      0 --:--:-- --:--:-- --:--:--   858
100  1906  100  1906    0     0   5015      0 --:--:-- --:--:-- --:--:-- 12878
Cloning Oh My Zsh...
Cloning into '/home/hugo/.oh-my-zsh'...
remote: Counting objects: 11280, done.
remote: Total 11280 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (11280/11280), 2.05 MiB | 950.00 KiB/s, done.
Resolving deltas: 100% (6173/6173), done.
Checking connectivity... done.
Looking for an existing zsh config...
Using the Oh My Zsh template file and adding it to ~/.zshrc
sed: unknown option -- i
usage: sed [-aEnru] command [file ...]
       sed [-aEnru] [-e command] [-f command_file] [file ...]
$ uname -a
OpenBSD elysion.barrera.io 5.6 GENERIC.MP#632 amd64
$ zsh  --version
zsh 5.0.5 (x86_64-unknown-openbsd5.6)
@apjanke
Copy link
Contributor

apjanke commented Feb 20, 2015

Not necessarily GNU sed; some non-GNU BSD seds, including FreeBSD and Mac OS X, also have -i. But yeah, -i is a nonstandard extension, and the installer is assuming it's supported. Should probably be removed for portability.

@apjanke
Copy link
Contributor

apjanke commented Feb 20, 2015

I've made a patch that removes the sed -i from the installer for portability. It's on my branch at https://github.com/apjanke/oh-my-zsh/tree/remove-sed-i.

It works for me on a fresh OpenBSD 5.6 installation. Do you want to test it out? To test it, remove your old oh-my-zsh installation (rm -rf ~/.oh-my-zsh) and do this.

curl https://raw.githubusercontent.com/apjanke/oh-my-zsh/remove-sed-i/tools/install.sh | sh

@WhyNotHugo
Copy link
Author

LGTM.
The other choice was to require gsed to be installed, but this seems way cleaner and more easily portable.

@apjanke
Copy link
Contributor

apjanke commented Feb 21, 2015

Looks like there's already a pending PR #2589 that will take care of this.

@jdrch
Copy link

jdrch commented Jun 6, 2019

LGTM.
The other choice was to require gsed to be installed, but this seems way cleaner and more easily portable.

FWIW I installed that on Project Trident and the original installation script still didn't work.

@jdrch
Copy link

jdrch commented Jun 6, 2019

I've made a patch that removes the sed -i from the installer for portability. It's on my branch at https://github.com/apjanke/oh-my-zsh/tree/remove-sed-i.

It works for me on a fresh OpenBSD 5.6 installation. Do you want to test it out? To test it, remove your old oh-my-zsh installation (rm -rf ~/.oh-my-zsh) and do this.

curl https://raw.githubusercontent.com/apjanke/oh-my-zsh/remove-sed-i/tools/install.sh | sh

TrueOS/Project Trident still don't support -i, causing the original installation to fail. Could update your branch with the latest OMZsh code? That way I can install the latest version. Or does your branch point to OMZsh automatically for updates?

@mcornella
Copy link
Member

How are you running the install script? We changed it recently, and this issue is really old.

@jdrch
Copy link

jdrch commented Jun 6, 2019

@mcornella Literally just running the scripts from the project front page.

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

does nothing and

sh -c "$(wget -O- https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

gives authentication errors.

I also tried downloading the script and then running

sh install.sh

and

sudo sh install.sh

but that did nothing, either.

The only thing that's worked for me has been @apjanke's script. Is there something I'm missing?

@mcornella
Copy link
Member

What's the output?

@mcornella
Copy link
Member

If none, run the script with sh -x install.sh.

@jdrch
Copy link

jdrch commented Jun 8, 2019

Here's what I get when I do that:


+ set -e
+ ZSH=/usr/home/judah/.oh-my-zsh
+ REPO=robbyrussell/oh-my-zsh
+ REMOTE=https://github.com/robbyrussell/oh-my-zsh.git
+ BRANCH=master
+ CHSH=yes
+ RUNZSH=yes
+ main
+ [ ! -t 0 ]
+ [ 0 -gt 0 ]
+ setup_color
+ tput colors
+ ncolors=80
+ [ -t 1 ]
+ [ 80 -ge 8 ]
+ tput setaf 1
+ RED=$'\033[27m'

@mcornella
Copy link
Member

If you run sh, does tput setaf 1 || echo fail show any error? Also, what's the value of $TERM?

@jdrch
Copy link

jdrch commented Jun 8, 2019

If you run sh, does tput setaf 1 || echo fail show any error?

Returns fail.

Also, what's the value of $TERM?

Returns zsh: command not found: xterm-256color.

@mcornella
Copy link
Member

Try downloading the script from https://raw.githubusercontent.com/mcornella/oh-my-zsh/installer-no-tput/tools/install.sh. Tell me if you can still see the coloring as well as if the installer continues without error.

@jdrch
Copy link

jdrch commented Jun 8, 2019

Try downloading the script from https://raw.githubusercontent.com/mcornella/oh-my-zsh/installer-no-tput/tools/install.sh. Tell me if you can still see the coloring as well as if the installer continues without error.

Here's what I get from sudo sh install.sh:


Cloning Oh My Zsh...
Cloning into '/root/.oh-my-zsh'...
remote: Enumerating objects: 1042, done.
remote: Counting objects: 100% (1042/1042), done.
remote: Compressing objects: 100% (959/959), done.
remote: Total 1042 (delta 23), reused 853 (delta 20), pack-reused 0
Receiving objects: 100% (1042/1042), 692.27 KiB | 8.24 MiB/s, done.
Resolving deltas: 100% (23/23), done.

Looking for an existing zsh config...
Using the Oh My Zsh template file and adding it to ~/.zshrc.

Time to change your default shell to zsh:
Do you want to change your default shell to zsh? [Y/n] Y
Changing the shell...
chsh: user information updated
Shell successfully changed to '/usr/local/bin/zsh'.

         __                                     __
  ____  / /_     ____ ___  __  __   ____  _____/ /_                                                                                                                                             
 / __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \                                                                                                                                            
/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / /                                                                                                                                            
\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/                                                                                                                                             
                        /____/                       ....is now installed!                                                                                                                      
                                                                                                                                                                                                
                                                                                                                                                                                                
Please look over the ~/.zshrc file to select plugins, themes, and options.                                                                                                                      
                                                                                                                                                                                                
p.s. Follow us on https://twitter.com/ohmyzsh                                                                                                                                                   
                                                                                                                                                                                                
p.p.s. Get stickers, shirts, and coffee mugs at https://shop.planetargon.com/collections/oh-my-zsh             

Oh, also, the coloring is back when I closed and reopened the terminal. So apparently the latest script was successful?

@mcornella
Copy link
Member

I meant if the messages posted by the installer were colored, I presume yes.

@jdrch
Copy link

jdrch commented Jun 9, 2019 via email

@mcornella
Copy link
Member

Ok, it's been fixed in 702a594. Thanks for the bug report!

@jdrch
Copy link

jdrch commented Jun 9, 2019 via email

@mcornella
Copy link
Member

It is the same one so yeah, you're good.

@jdrch
Copy link

jdrch commented Jun 9, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants