Install Zsh Ubuntu Install Z-shell (Oh My Zsh) on Ubuntu 18.04 LTS

mskian profile image Santhosh Veer ・1 min read

Z-shell for Ubuntu

  • Update the packages
sudo apt-get update
sudo apt upgrade
  • Install prerequisite packages (ZSH, powerline & powerline fonts)
sudo apt install zsh
sudo apt-get install powerline fonts-powerline
  • Clone the Oh My Zsh Respo
git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
  • Create a New ZSH configuration file
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
  • Set up a Fancy theme for your Terminal - Open .zshrc File using nano editor
nano .zshrc
  • Find the line ZSH_THEME="robbyrussell" replace robbyrussell with agnoster theme in .zshrc File (CTRL + X & Enter to Save)
  • Change your Default Shell
chsh -s /bin/zsh
cd .oh-my-zsh

Want Syntax Highlighting? install ZSH Syntax Highlighting for Oh My Zsh

  • Clone the ZSH Syntax Highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.zsh-syntax-highlighting" --depth 1
  • Add syntax-highlighting in .zshrc Configuration
echo "source $HOME/.zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> "$HOME/.zshrc"

Revert Back to Default Shell

chsh -s /bin/bash

Posted on Oct 4 '18 by:

mskian profile

Santhosh Veer


Blogger - Web Developer - Open Source Lover


markdown guide

Just a footnote, for this command to be effective:

chsh -s /bin/zsh

you need to logout and then login again.


Better post about zsh and oh my zsh that i've ever seen.


And, some day, be sufficiently annoyed by the very under-average performance of that combination and happily fall back into the less shiny, but very understanding lap of the TCSH - at least that happened to me. ;-)


For AWS Lightsail users, this one worked for me:

sudo chsh -s /usr/bin/zsh $(whoami)


This is my go-to article whenever I need to set up a machine with Zsh.
Fantastic article


After struggling to have this working on my machines with random guides from the internet... everything is much clearer now.
Very good explanation.


Thank you. Straightforward guide ever!


What a wonderful post. Thanks to the Author.