14

I have upgraded to Ubuntu 18.04 and have been trying to install zsh. I have went through all the methods, and am able to use it, though when I try to install Oh My Zsh, it starts to run and then has an error:

Zsh not installed! Install zsh first.

I have used cat and everything to confirm that it is in fact installed (obviously though, because I was using it?) What am I doing wrong?

3
  • 1
    This is a question on how OnMyZsh detects the presence/abscence of zsh - not about Ubuntu
    – waltinator
    May 6, 2018 at 0:08
  • 1
    So it is a problem with ohmyzsh and not zsh
    – Panther
    May 6, 2018 at 0:08
  • Close voters. Crafting answer
    – Elder Geek
    May 9, 2018 at 0:01

2 Answers 2

19

ohmyzsh requires the zsh shell to install.

The issue is explained in detail here.

A workaround is to install zsh first, change to the zsh shell and then get and run ohmyzsh the same way you did before.

Example using wget :

sudo apt install zsh
apt-get install git-core
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh

ohmyzsh will report that it's successfully installed with this or similar output:

--2018-05-08 18:44:07--  https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh
Resolving github.com (github.com)... 192.30.253.113, 192.30.253.112
Connecting to github.com (github.com)|192.30.253.113|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh [following]
--2018-05-08 18:44:07--  https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.44.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.44.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3941 (3.8K) [text/plain]
Saving to: ‘STDOUT’

-                                100%[==========================================================>]   3.85K  --.-KB/s    in 0s      

2018-05-08 18:44:07 (57.9 MB/s) - written to stdout [3941/3941]

Cloning Oh My Zsh...
Cloning into '/home/me/.oh-my-zsh'...
remote: Counting objects: 858, done.
remote: Compressing objects: 100% (721/721), done.
remote: Total 858 (delta 16), reused 780 (delta 10), pack-reused 0
Receiving objects: 100% (858/858), 572.49 KiB | 0 bytes/s, done.
Resolving deltas: 100% (16/16), done.
Checking connectivity... done.
Looking for an existing zsh config...
Using the Oh My Zsh template file and adding it to ~/.zshrc
I can't change your shell automatically because this system does not have chsh.
Please manually change your default shell to zsh!
         __                                     __   
  ____  / /_     ____ ___  __  __   ____  _____/ /_  
 / __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \ 
/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / / 
\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/  
                        /____/                       ....is now installed!


Please look over the ~/.zshrc file to select plugins, themes, and options.

If you wish to change shells you can then do so by issuing the commands

chsh -s `which zsh`
sudo reboot

The reboot may not be required, you could likely log out and then log back in.

To revert back to the default shell, just issue the command

chsh -s /bin/bash

Sources:

https://gist.github.com/tsabat/1498393

https://github.com/robbyrussell/oh-my-zsh/issues/227#issuecomment-825773

man chsh

0
2

This is what i every time do After installing a ubuntu/debian on Physical/Virtual computer to setup ZSH.

Check Shell

echo $0
  1. Install Git, cURL, wget as prequisites
sudo apt install curl git wget
  1. Install ZSH shell
sudo apt install zsh
  1. Change Default Shell
chsh -s $(which zsh)

Alternative 3 ways


------------------------>Now Reboot The Computer (Linux)<------------------------



Check Shell Again

echo $0
  1. Download Oh-My-ZSH

https://ohmyz.sh/

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  1. Download any Powerline Font ---> Fira font, Hack Font or others to get best experience.

  2. Download ZSH Auto Suggestion

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
  1. Download ZSH Syntax Highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
  1. Add this to ~/.zshrc file

Obviously before source $ZSH/oh-my-zsh.sh part

# default theme
# ZSH_THEME="robbyrussell"
ZSH_THEME="agnoster"

plugins=(
    git
    history
    zsh-autosuggestions
    zsh-syntax-highlighting
    command-not-found
)
  1. (Optional) Download Power Level 10k Theme
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc
  1. (If you chose 9) Go to powerlevel10k folder & run this to customize style
p10k configure

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .