Create a gist now

Instantly share code, notes, and snippets.

@tsabat /zsh.md
Last active Mar 26, 2017

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
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
Owner
tsabat commented Jan 13, 2012

changed. thanks.

@oleander

Worked perfectly, thanks!

@RohitRox

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

@nerfmiester

Worked perfectly thanks

@GauthierD-

I love you !

@otobrglez

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

apt-get install zsh
@sahilsinha

You also need to have git installed obviously

@Fernando9

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
Asmmund commented Mar 7, 2013

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

@Asmmund
Asmmund commented Mar 7, 2013

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

@digitup
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

@EdgarOrtegaRamirez

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

@indolering

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

Thanks! It works well..
πŸ‘

@tmaffia
tmaffia commented Jan 7, 2014

Thanks for this!

@Naatan
Naatan 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
Lujaw commented Feb 13, 2014

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

@ahmadajmi

Thanks

@robbyrussell

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

@sgsheg
sgsheg commented May 6, 2014

Thanks!

@Fuhrmann

Thanks!

@keevitaja

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

@darrenhaken

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

@rakesh87

:) Thanks!

@chrisdchristo

thanks

@slipdigital

n1 :)

@iovino
iovino commented Aug 24, 2014

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

@rands0n
rands0n commented Sep 15, 2014

πŸ‘

@thinkingmedia

Thank you!

@Bshally
Bshally commented Oct 21, 2014

Great resource! 10/10, would curl again.

@kimly
kimly commented Nov 20, 2014

thanks

@tanay1337

It's perfect! Works like a charm!

@rqbukhari

πŸ‘

@agauniyal

Perfect πŸ‘

@NouranMahmoud

Thanks (y)

@futhrevo

Thanks

@alexfalcucc

It's worked, thanks! ✌️

@noinlijin

thanks

@iPoul
iPoul commented Feb 26, 2015

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

@PhilipTang

δΉˆδΉˆε“’~

@aguidis
aguidis commented Mar 18, 2015

nice thanks

@igregson
igregson commented Apr 4, 2015

nearly 2 years later, this approach still works.

many thanks :)

@yetithefoot

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

sudo chsh -s $(which zsh) username

http://superuser.com/a/231736

@adiazpy
adiazpy commented May 6, 2015

Great! Also works on Raspberry Pi 2

@sadfuzzy
sadfuzzy commented May 7, 2015

thanks a lot! πŸ‘

@juddflamm

Thanks!

@fes300
fes300 commented Jun 7, 2015

thanks, been on that for a while

@brunojppb

Thank you! Thumbs up!!!

@mhipo1364

Thanks πŸ‘

@erinwan
erinwan commented Aug 2, 2015

Thank you!

@chrismipi

Thanks

@maciao
maciao commented Sep 28, 2015

love you ! !!!

@ltongues
ltongues commented Oct 3, 2015

Awesome!

@xieweizhi

Thanks πŸ‘

@fisher
fisher commented Nov 21, 2015

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

@johnjelinek

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
maciao commented Dec 2, 2015

thanks & Love u <3 !!

@bboyairwreck

Thank you! Worked perfectly!

@yosvelquintero

Thanks!

@niallobrien

Thank you. :)

@mhipo1364

Cool, Thanks πŸ‘

@hackingsimplicity

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
Krijger commented Feb 12, 2016

Thanks for the nice Gist

@akhileshappala

Thanks

@ramswaroop

Worked like a charm, thanks a ton!

@danielcodes

Thanks!

@ozzieperez

Thanks!

@searchpcc

Thanks!

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

@JunilJacob

Thanks!

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

Thanks!!!

@fastCargo

@adnnn - this worked like a charm - thanks!

@vpakg
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

@PangeranWeb

Thanks Captain !!!

@hasangilak
hasangilak commented May 5, 2016 edited

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

@hector-cortez

Thanks, works in Raspbian (Raspberry Pi)

@danilobjr

Oh man. It works! Thank you so much!

@rezayds
rezayds commented Jun 27, 2016

Thanks man!

@luizs81
luizs81 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
kas commented Aug 3, 2016

Awesome! Thanks. Works on Ubuntu Mate 16.04.1

@Server4001

Works great!

@gazatem
gazatem commented Sep 7, 2016

great job!

@dineshadepu

Thank you!

@kevinzzz007

Thanks!

@chaicko
chaicko commented Oct 3, 2016

Excellent!

@mentorkadriu

Thanks! Installed on Bash on Ubuntu on Windows

@hmny
hmny 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
IOpuk commented Oct 14, 2016

Thanks!

@BorisLevanov

Works like a charm! :)

@HereComesJuju

Many thanks ! Works perfectly !

@Webysther
Webysther commented Jan 26, 2017 edited

For docker debian based:

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

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

Worked like a charm. Thanks!

@Pioruniasty

How to rollback to "vanilla bash" :) ?

@joelcn
joelcn commented Mar 7, 2017

well done mate, nice tutorial, simple and useful

@waterlili

Thanks:)

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