Create a gist now

Instantly share code, notes, and snippets.

@tsabat /
Last active Feb 22, 2018

What would you like to do?
Getting oh-my-zsh to work in Ubuntu


apt-get install zsh
apt-get install git-core

Getting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh

wget -O - | zsh

and then you change your shell to zsh

chsh -s `which zsh`

and then restart

sudo shutdown -r 0

This problem is explained in depth in this issue

ryancole commented Jan 7, 2012

it looks like you're changing the shell to bash, instead of zsh. is this because of some thing oh-my-zsh does, or is this a typo?


tsabat commented Jan 13, 2012

changed. thanks.

Worked perfectly, thanks!

Thanx for share. Worked perfectly n i loved the git friendly default theme !!

Worked perfectly thanks

I love you !

You have to have "zsh" installed on Ubuntu first... Then it works :)

apt-get install zsh

You also need to have git installed obviously

Sometimes it is difficult to make it run in ubuntu, so I use
curl -L | sh
chsh -s which zsh
and after that restart it
sudo shutdown -r 0

Asmmund commented Mar 7, 2013

Thanks for your method! It's what i needed!

Asmmund commented Mar 7, 2013

on one of the machines had to run
sudo apt-get install zsh
before following these footstepts

digitup commented Apr 30, 2013

Thank you very much. It works as expected :-). If you don't have git installed it should be installed as well:
sudo apt-get install git

Hey, I just needed to run firstly sudo apt-get update

For whatever reason, chsh -swhich zsh``didn't work for me butchsh -s /bin/zsh did. It might have just been a coincidence, but give it shot if you are having trouble.

Thanks! It works well..

tmaffia commented Jan 7, 2014

Thanks for this!

Naatan commented Jan 14, 2014

Any reason you chose to include a "restart" step in this? You seem to have properly fixed it in but then changed it back to restart. I don't really see why this would be necessary and it kind of promotes bad practice.

Lujaw commented Feb 13, 2014

awesome !! worked like a charm.. thanks for sharing the information..


We have some revised install instructions now on

sgsheg commented May 6, 2014



rebooting the machine is not necessary. just log out and back in!

Can you give the exact details? I can't find them on the ohmyzsh site.

:) Thanks!


n1 :)

iovino commented Aug 24, 2014

Thanks! This is working on Raspbian - Debian Wheezy too.

rands0n commented Sep 15, 2014


Thank you!

Bshally commented Oct 21, 2014

Great resource! 10/10, would curl again.

kimly commented Nov 20, 2014


It's perfect! Works like a charm!


Perfect πŸ‘

Thanks (y)


It's worked, thanks! ✌️


iPoul commented Feb 26, 2015

For some odd reason i can't change directory with it.


aguidis commented Mar 18, 2015

nice thanks

igregson commented Apr 4, 2015

nearly 2 years later, this approach still works.

many thanks :)

If you need to setup zsh for concrete user you can run:

sudo chsh -s $(which zsh) username

adiazpy commented May 6, 2015

Great! Also works on Raspberry Pi 2

sadfuzzy commented May 7, 2015

thanks a lot! πŸ‘


fes300 commented Jun 7, 2015

thanks, been on that for a while

Thank you! Thumbs up!!!

Thanks πŸ‘

erinwan commented Aug 2, 2015

Thank you!


maciao commented Sep 28, 2015

love you ! !!!

ltongues commented Oct 3, 2015


Thanks πŸ‘

fisher commented Nov 21, 2015

man, you don't need to reboot, just to relogin after chsh /facepalm

This was all I needed to do.

apt-get install -y zsh git-core
sh -c "$(curl -fsSL"

maciao commented Dec 2, 2015

thanks & Love u <3 !!

Thank you! Worked perfectly!


Thank you. :)

Cool, Thanks πŸ‘

It works with Xubuntu.

Note that I got an error when I typed: wget -O - | zsh

But I ignored the error and went on. It ended up working.

This is a pretty good YouTube clip on how one guy uses Zsh:

Krijger commented Feb 12, 2016

Thanks for the nice Gist


Worked like a charm, thanks a ton!




But,In the fact, It did not need to use sudo shutdown -r 0 to reboot. Just Logout then Login.


adnnn commented Mar 12, 2016

I couldn't change directory and then I ran this and everything worked fine.

apt-get install -y zsh git-core
sh -c "$(curl -fsSL"


@adnnn - this worked like a charm - thanks!

vpakg commented Apr 6, 2016

Just as a side note, if you don't want to restart your machine (last step), you should be able to execute zsh with exec zsh

Thanks Captain !!!

hasangilak commented May 5, 2016

for anyone who has a problem with chsh -s 'which zsh', this answer will work fine

Thanks, works in Raspbian (Raspberry Pi)

Oh man. It works! Thank you so much!

rezayds commented Jun 27, 2016

Thanks man!

luizs81 commented Jul 5, 2016

Just in case if someone else is trying to add this in a "Vagrant bootstrap file"

kas commented Aug 3, 2016

Awesome! Thanks. Works on Ubuntu Mate 16.04.1

Works great!

gazatem commented Sep 7, 2016

great job!

Thank you!


chaicko commented Oct 3, 2016


Thanks! Installed on Bash on Ubuntu on Windows

yar00001 commented Oct 9, 2016

If you are hear to replace zsh with default bash IN WINDOWS 10, add this to your ./bashrc file:

# Launch Zsh
if [ -t 1 ]; then
exec zsh

IOpuk commented Oct 14, 2016


Works like a charm! :)

Many thanks ! Works perfectly !

Webysther commented Jan 26, 2017

For docker debian based:

bash -c "$(wget -O -)"

Thanks the author and everyone here!
I need to have git and zsh installed before doing so. Plus, log out does not work for me, but restart does well.

Worked like a charm. Thanks!

How to rollback to "vanilla bash" :) ?

joelcn commented Mar 7, 2017

well done mate, nice tutorial, simple and useful


dazjavier commented Apr 25, 2017

Thanks! Works in Ubuntu Gnome 17.04

atilkan commented May 13, 2017

You don't need any of this. Go to official sites and read people. It is simpler and explains well.

Good one. Thank you. πŸ‘

deyvin commented Jul 18, 2017


Hepic commented Sep 11, 2017

Thank you !


dimpiax commented Oct 23, 2017

for AMI Linux, chsh -s $(which zsh) ec2-user

bin9003 commented Nov 11, 2017


physhik commented Nov 27, 2017


webhat commented Dec 6, 2017

@Naatan the reason he probably does that is that window managers don't always pick up the changes automatically. Saying reboot rather than adding a procedure to install each window manager makes the instructions easier to follow.

Thanks πŸ‘

Ahm4d-94 commented Jan 8, 2018

thanks bro πŸ‘

li19860 commented Jan 11, 2018

thanks bro.

Thank you!

aramatev commented Feb 15, 2018

You need the Powerline font to have your CLI with show git icons correctly
sudo apt install fonts-powerline


git clone --depth=1
# install
cd fonts

HCrane commented Feb 21, 2018

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment