Skip to content

Instantly share code, notes, and snippets.

@tsabat tsabat/zsh.md
Last active Aug 23, 2019

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

Prereq:

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 https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Owner Author

commented Jan 13, 2012

changed. thanks.

@oleander

This comment has been minimized.

Copy link

commented Jan 20, 2012

Worked perfectly, thanks!

@RohitRox

This comment has been minimized.

Copy link

commented May 20, 2012

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

@nerfmiester

This comment has been minimized.

Copy link

commented Jun 25, 2012

Worked perfectly thanks

@GauthierD-

This comment has been minimized.

Copy link

commented Jul 13, 2012

I love you !

@otobrglez

This comment has been minimized.

Copy link

commented Aug 24, 2012

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

apt-get install zsh
@sahilsinha

This comment has been minimized.

Copy link

commented Oct 3, 2012

You also need to have git installed obviously

@Fernando9

This comment has been minimized.

Copy link

commented Jan 6, 2013

Sometimes it is difficult to make it run in ubuntu, so I use
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
then
chsh -s which zsh
and after that restart it
sudo shutdown -r 0

@Asmmund

This comment has been minimized.

Copy link

commented Mar 7, 2013

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

@Asmmund

This comment has been minimized.

Copy link

commented Mar 7, 2013

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

@digitup

This comment has been minimized.

Copy link

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

@EdgarOrtegaRamirez

This comment has been minimized.

Copy link

commented Sep 10, 2013

Hey, I just needed to run firstly sudo apt-get update
๐Ÿ‘

@indolering

This comment has been minimized.

Copy link

commented Dec 1, 2013

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.

@qiyuangong

This comment has been minimized.

Copy link

commented Dec 11, 2013

Thanks! It works well..
๐Ÿ‘

@tmaffia

This comment has been minimized.

Copy link

commented Jan 7, 2014

Thanks for this!

@Naatan

This comment has been minimized.

Copy link

commented Jan 14, 2014

Any reason you chose to include a "restart" step in this? You seem to have properly fixed it in https://gist.github.com/tsabat/1498393/422c7e4488c5dfc616b8e9c58f142c9d2cb44621 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

This comment has been minimized.

Copy link

commented Feb 13, 2014

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

@ahmadajmi

This comment has been minimized.

Copy link

commented Mar 12, 2014

Thanks

@robbyrussell

This comment has been minimized.

Copy link

commented Mar 21, 2014

We have some revised install instructions now on http://ohmyz.sh/

@sgsheg

This comment has been minimized.

Copy link

commented May 6, 2014

Thanks!

@Fuhrmann

This comment has been minimized.

Copy link

commented May 26, 2014

Thanks!

@keevitaja

This comment has been minimized.

Copy link

commented Jun 8, 2014

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

@darrenhaken

This comment has been minimized.

Copy link

commented Jun 24, 2014

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

@rakesh87

This comment has been minimized.

Copy link

commented Jul 15, 2014

:) Thanks!

@chrisdchristo

This comment has been minimized.

Copy link

commented Jul 31, 2014

thanks

@slipdigital

This comment has been minimized.

Copy link

commented Aug 4, 2014

n1 :)

@iovino

This comment has been minimized.

Copy link

commented Aug 24, 2014

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

@rands0n

This comment has been minimized.

Copy link

commented Sep 15, 2014

๐Ÿ‘

@thinkingmedia

This comment has been minimized.

Copy link

commented Oct 4, 2014

Thank you!

@Bshally

This comment has been minimized.

Copy link

commented Oct 21, 2014

Great resource! 10/10, would curl again.

@kimly

This comment has been minimized.

Copy link

commented Nov 20, 2014

thanks

@tanay1337

This comment has been minimized.

Copy link

commented Nov 25, 2014

It's perfect! Works like a charm!

@rqbukhari

This comment has been minimized.

Copy link

commented Nov 25, 2014

๐Ÿ‘

@agauniyal

This comment has been minimized.

Copy link

commented Dec 8, 2014

Perfect ๐Ÿ‘

@NouranMahmoud

This comment has been minimized.

Copy link

commented Dec 30, 2014

Thanks (y)

@futhrevo

This comment has been minimized.

Copy link

commented Jan 15, 2015

Thanks

@alexfalcucci

This comment has been minimized.

Copy link

commented Jan 16, 2015

It's worked, thanks! โœŒ๏ธ

@noinlijin

This comment has been minimized.

Copy link

commented Jan 23, 2015

thanks

@iPoul

This comment has been minimized.

Copy link

commented Feb 26, 2015

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

@PhilipTang

This comment has been minimized.

Copy link

commented Mar 7, 2015

ไนˆไนˆๅ“’~

@aguidis

This comment has been minimized.

Copy link

commented Mar 18, 2015

nice thanks

@igregson

This comment has been minimized.

Copy link

commented Apr 4, 2015

nearly 2 years later, this approach still works.

many thanks :)

@yetithefoot

This comment has been minimized.

Copy link

commented Apr 21, 2015

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

sudo chsh -s $(which zsh) username

http://superuser.com/a/231736

@adiazpy

This comment has been minimized.

Copy link

commented May 6, 2015

Great! Also works on Raspberry Pi 2

@sadfuzzy

This comment has been minimized.

Copy link

commented May 7, 2015

thanks a lot! ๐Ÿ‘

@juddflamm

This comment has been minimized.

Copy link

commented May 11, 2015

Thanks!

@fes300

This comment has been minimized.

Copy link

commented Jun 7, 2015

thanks, been on that for a while

@brunojppb

This comment has been minimized.

Copy link

commented Jun 15, 2015

Thank you! Thumbs up!!!

@mhipo1364

This comment has been minimized.

Copy link

commented Jul 30, 2015

Thanks ๐Ÿ‘

@erinwan

This comment has been minimized.

Copy link

commented Aug 2, 2015

Thank you!

@chrismipi

This comment has been minimized.

Copy link

commented Sep 15, 2015

Thanks

@maciao

This comment has been minimized.

Copy link

commented Sep 28, 2015

love you ! !!!

@abelkov

This comment has been minimized.

Copy link

commented Oct 3, 2015

Awesome!

@xieweizhi

This comment has been minimized.

Copy link

commented Nov 9, 2015

Thanks ๐Ÿ‘

@fisher

This comment has been minimized.

Copy link

commented Nov 21, 2015

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

@johnjelinek

This comment has been minimized.

Copy link

commented Dec 1, 2015

This was all I needed to do.

apt-get install -y zsh git-core
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
@maciao

This comment has been minimized.

Copy link

commented Dec 2, 2015

thanks & Love u <3 !!

@bboyairwreck

This comment has been minimized.

Copy link

commented Dec 13, 2015

Thank you! Worked perfectly!

@yosvelquintero

This comment has been minimized.

Copy link

commented Dec 22, 2015

Thanks!

@niallobrien

This comment has been minimized.

Copy link

commented Jan 16, 2016

Thank you. :)

@mhipo1364

This comment has been minimized.

Copy link

commented Feb 10, 2016

Cool, Thanks ๐Ÿ‘

@hackingsimplicity

This comment has been minimized.

Copy link

commented Feb 10, 2016

It works with Xubuntu.

Note that I got an error when I typed: wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -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: https://www.youtube.com/watch?v=m07MiM6rmMc

@Krijger

This comment has been minimized.

Copy link

commented Feb 12, 2016

Thanks for the nice Gist

@akhileshappala

This comment has been minimized.

Copy link

commented Feb 21, 2016

Thanks

@rampatra

This comment has been minimized.

Copy link

commented Feb 24, 2016

Worked like a charm, thanks a ton!

@danielcodes

This comment has been minimized.

Copy link

commented Mar 1, 2016

Thanks!

@ozzieperez

This comment has been minimized.

Copy link

commented Mar 5, 2016

Thanks!

@searchpcc

This comment has been minimized.

Copy link

commented Mar 12, 2016

Thanks!

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

@JunilJacob

This comment has been minimized.

Copy link

commented Mar 12, 2016

Thanks!

@adnnn

This comment has been minimized.

Copy link

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 https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
@ruooooooli

This comment has been minimized.

Copy link

commented Mar 18, 2016

Thanks!!!

@fastCargo

This comment has been minimized.

Copy link

commented Apr 4, 2016

@adnnn - this worked like a charm - thanks!

@vpakg

This comment has been minimized.

Copy link

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

@PangeranWeb

This comment has been minimized.

Copy link

commented Apr 12, 2016

Thanks Captain !!!

@hasangilak

This comment has been minimized.

Copy link

commented May 5, 2016

for anyone who has a problem with chsh -s 'which zsh', this answer will work fine
http://askubuntu.com/a/660014

@hector-cortez

This comment has been minimized.

Copy link

commented May 22, 2016

Thanks, works in Raspbian (Raspberry Pi)

@danilobjr

This comment has been minimized.

Copy link

commented Jun 26, 2016

Oh man. It works! Thank you so much!

@rezayds

This comment has been minimized.

Copy link

commented Jun 27, 2016

Thanks man!

@luizs81

This comment has been minimized.

Copy link

commented Jul 5, 2016

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

http://stackoverflow.com/questions/25763017/install-oh-my-zsh-on-a-vagrant-box-as-part-of-the-bootstrap-process

@kas

This comment has been minimized.

Copy link

commented Aug 3, 2016

Awesome! Thanks. Works on Ubuntu Mate 16.04.1

@Server4001

This comment has been minimized.

Copy link

commented Aug 28, 2016

Works great!

@gazatem

This comment has been minimized.

Copy link

commented Sep 7, 2016

great job!

@dineshadepu

This comment has been minimized.

Copy link

commented Sep 17, 2016

Thank you!

@kevinzzz007

This comment has been minimized.

Copy link

commented Sep 17, 2016

Thanks!

@chaicko

This comment has been minimized.

Copy link

commented Oct 3, 2016

Excellent!

@mentorkadriu

This comment has been minimized.

Copy link

commented Oct 7, 2016

Thanks! Installed on Bash on Ubuntu on Windows

@yar00001

This comment has been minimized.

Copy link

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
fi
@IOpuk

This comment has been minimized.

Copy link

commented Oct 14, 2016

Thanks!

@BorisLevanov

This comment has been minimized.

Copy link

commented Nov 18, 2016

Works like a charm! :)

@HereComesJuju

This comment has been minimized.

Copy link

commented Jan 11, 2017

Many thanks ! Works perfectly !

@Webysther

This comment has been minimized.

Copy link

commented Jan 26, 2017

For docker debian based:

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

This comment has been minimized.

Copy link

commented Feb 25, 2017

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.
๐Ÿ‘

@seanfealy

This comment has been minimized.

Copy link

commented Feb 26, 2017

Worked like a charm. Thanks!

@pawel-miczka

This comment has been minimized.

Copy link

commented Mar 6, 2017

How to rollback to "vanilla bash" :) ?

@joelcn

This comment has been minimized.

Copy link

commented Mar 7, 2017

well done mate, nice tutorial, simple and useful

@waterlili

This comment has been minimized.

Copy link

commented Mar 10, 2017

Thanks:)

@dazjavier

This comment has been minimized.

Copy link

commented Apr 25, 2017

Thanks! Works in Ubuntu Gnome 17.04

@atilkan

This comment has been minimized.

Copy link

commented May 13, 2017

You don't need any of this. Go to official sites and read people. It is simpler and explains well.
http://ohmyz.sh/
https://wiki.ubuntu.com/ChangingShells

@srebalaji

This comment has been minimized.

Copy link

commented Jun 12, 2017

Good one. Thank you. ๐Ÿ‘

@deyvin

This comment has been minimized.

Copy link

commented Jul 18, 2017

Thanks!

@Hepic

This comment has been minimized.

Copy link

commented Sep 11, 2017

Thank you !

@amsheehan

This comment has been minimized.

Copy link

commented Oct 22, 2017

Champion!

@dimpiax

This comment has been minimized.

Copy link

commented Oct 23, 2017

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

@bin9003

This comment has been minimized.

Copy link

commented Nov 11, 2017

ๆฃ’ๆฃ’็š„๏ผ๏ผ

@physhik

This comment has been minimized.

Copy link

commented Nov 27, 2017

Thanks!

@webhat

This comment has been minimized.

Copy link

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.

@mahenrique

This comment has been minimized.

Copy link

commented Dec 11, 2017

Thanks ๐Ÿ‘

@Ahm4d-94

This comment has been minimized.

Copy link

commented Jan 8, 2018

thanks bro ๐Ÿ‘

@li19860

This comment has been minimized.

Copy link

commented Jan 11, 2018

thanks bro.

@sahota14

This comment has been minimized.

Copy link

commented Jan 13, 2018

Thank you!

@aramatev

This comment has been minimized.

Copy link

commented Feb 15, 2018

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

OR

git clone https://github.com/powerline/fonts.git --depth=1
# install
cd fonts
./install.sh```
@HCrane

This comment has been minimized.

Copy link

commented Feb 21, 2018

Thank you!

@lauragift21

This comment has been minimized.

Copy link

commented Feb 28, 2018

Thanks for this. How do I confirm it's working on my terminal?

@saidziani

This comment has been minimized.

Copy link

commented Apr 10, 2018

Thanks a lot!

@jmau111

This comment has been minimized.

Copy link

commented Apr 26, 2018

very nice and still useflul !!!

@DennisMufasa

This comment has been minimized.

Copy link

commented May 7, 2018

worked like a charm!

@blueshell2017

This comment has been minimized.

Copy link

commented Jun 1, 2018

well,thanks a lot,nearly there years later, this approach still works,but ,maybe use logout is well?shutdown -r 0 is very rough?hahhaha:)

@gitpetrova

This comment has been minimized.

Copy link

commented Jul 26, 2018

thanks a lot!

@javiros

This comment has been minimized.

Copy link

commented Aug 19, 2018

Fantastic! Thank you!!

@rishabhdeepsingh

This comment has been minimized.

Copy link

commented Sep 7, 2018

Thanks a LOT Bro

@mariaanko

This comment has been minimized.

Copy link

commented Sep 13, 2018

cheers!

@VenkateswaraT

This comment has been minimized.

Copy link

commented Sep 26, 2018

Thank you

@Mr-Quinn

This comment has been minimized.

Copy link

commented Sep 26, 2018

Thank you... zsh &&.oh-my-zsh is the first apt I install on any new system!

@themoralpanda

This comment has been minimized.

Copy link

commented Nov 9, 2018

Thanks for the share :)

@franciscodara

This comment has been minimized.

Copy link

commented Feb 24, 2019

Guys, how uninstall this tutor? Help me please!

@sinscary

This comment has been minimized.

Copy link

commented Mar 19, 2019

Awesome man

@mrroot5

This comment has been minimized.

Copy link

commented Apr 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You canโ€™t perform that action at this time.