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

Santhosh Veer @mskian

About: Blogger - Web Developer - Open Source Lover

Joined:
Oct 4, 2018

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

Publish Date: Oct 4 '18
228 14

Z-shell for Ubuntu

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

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
Enter fullscreen mode Exit fullscreen mode
  • Add syntax-highlighting in .zshrc Configuration
echo "source $HOME/.zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> "$HOME/.zshrc"
Enter fullscreen mode Exit fullscreen mode

Revert Back to Default Shell

chsh -s /bin/bash
Enter fullscreen mode Exit fullscreen mode

Comments 14 total

  • АнонимMay 23, 2019

    [deleted]

  • Rong Sen Ng
    Rong Sen NgJun 13, 2019

    Thank you. Straightforward guide ever!

  • a_m_dev
    a_m_devNov 26, 2019

    chsh -s /bin/bash username

  • Ruan
    RuanJan 22, 2020

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

  • Akash
    AkashJan 25, 2020

    chsh -s /usr/bin/zsh

  • Zulhilmi Zainudin
    Zulhilmi ZainudinFeb 7, 2020

    For AWS Lightsail users, this one worked for me:

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

  • Suryaa Jha
    Suryaa JhaFeb 16, 2020

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

  • Listiananda Apriliawan
    Listiananda ApriliawanFeb 22, 2020

    Thank you. It works for me.

  • Ivan dos Reis Andrade
    Ivan dos Reis AndradeMar 4, 2020

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

  • mohammadreza berneti
    mohammadreza bernetiMar 12, 2020

    great

  • Sunday Ezeilo
    Sunday EzeiloMay 11, 2020

    What a wonderful post. Thanks to the Author.

  • landileite
    landileiteJul 6, 2020

    Thank You!

Add comment