Skip to content

Instantly share code, notes, and snippets.

@tsabat

tsabat/zsh.md

Last active Oct 8, 2020
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

@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

This comment has been minimized.

Copy link
Owner Author

@tsabat tsabat commented Jan 13, 2012

changed. thanks.

@oleander

This comment has been minimized.

Copy link

@oleander oleander commented Jan 20, 2012

Worked perfectly, thanks!

@RohitRox

This comment has been minimized.

Copy link

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

@nerfmiester nerfmiester commented Jun 25, 2012

Worked perfectly thanks

@GauthierD-

This comment has been minimized.

Copy link

@GauthierD- GauthierD- commented Jul 13, 2012

I love you !

@otobrglez

This comment has been minimized.

Copy link

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

@sahilsinha sahilsinha commented Oct 3, 2012

You also need to have git installed obviously

@Fernando9

This comment has been minimized.

Copy link

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

@Asmmund Asmmund commented Mar 7, 2013

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

@Asmmund

This comment has been minimized.

Copy link

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

@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

This comment has been minimized.

Copy link

@EdgarOrtegaRamirez EdgarOrtegaRamirez commented Sep 10, 2013

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

@indolering

This comment has been minimized.

Copy link

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

@qiyuangong qiyuangong commented Dec 11, 2013

Thanks! It works well..
๐Ÿ‘

@tmaffia

This comment has been minimized.

Copy link

@tmaffia tmaffia commented Jan 7, 2014

Thanks for this!

@Naatan

This comment has been minimized.

Copy link

@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

This comment has been minimized.

Copy link

@Lujaw Lujaw commented Feb 13, 2014

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

@ahmadajmi

This comment has been minimized.

Copy link

@ahmadajmi ahmadajmi commented Mar 12, 2014

Thanks

@robbyrussell

This comment has been minimized.

Copy link

@robbyrussell robbyrussell commented Mar 21, 2014

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

@sgsheg

This comment has been minimized.

Copy link

@sgsheg sgsheg commented May 6, 2014

Thanks!

@Fuhrmann

This comment has been minimized.

Copy link

@Fuhrmann Fuhrmann commented May 26, 2014

Thanks!

@keevitaja

This comment has been minimized.

Copy link

@keevitaja keevitaja commented Jun 8, 2014

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

@darrenhaken

This comment has been minimized.

Copy link

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

@rakesh87 rakesh87 commented Jul 15, 2014

:) Thanks!

@chrisdchristo

This comment has been minimized.

Copy link

@chrisdchristo chrisdchristo commented Jul 31, 2014

thanks

@slipdigital

This comment has been minimized.

Copy link

@slipdigital slipdigital commented Aug 4, 2014

n1 :)

@iovino

This comment has been minimized.

Copy link

@iovino iovino commented Aug 24, 2014

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

@rands0n

This comment has been minimized.

Copy link

@rands0n rands0n commented Sep 15, 2014

๐Ÿ‘

@thinkingmedia

This comment has been minimized.

Copy link

@thinkingmedia thinkingmedia commented Oct 4, 2014

Thank you!

@Bshally

This comment has been minimized.

Copy link

@Bshally Bshally commented Oct 21, 2014

Great resource! 10/10, would curl again.

@kimly

This comment has been minimized.

Copy link

@kimly kimly commented Nov 20, 2014

thanks

@tanay1337

This comment has been minimized.

Copy link

@tanay1337 tanay1337 commented Nov 25, 2014

It's perfect! Works like a charm!

@rqbukhari

This comment has been minimized.

Copy link

@rqbukhari rqbukhari commented Nov 25, 2014

๐Ÿ‘

@agauniyal

This comment has been minimized.

Copy link

@agauniyal agauniyal commented Dec 8, 2014

Perfect ๐Ÿ‘

@NouranMahmoud

This comment has been minimized.

Copy link

@NouranMahmoud NouranMahmoud commented Dec 30, 2014

Thanks (y)

@futhrevo

This comment has been minimized.

Copy link

@futhrevo futhrevo commented Jan 15, 2015

Thanks

@alexfalcucci

This comment has been minimized.

Copy link

@alexfalcucci alexfalcucci commented Jan 16, 2015

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

@noinlijin

This comment has been minimized.

Copy link

@noinlijin noinlijin commented Jan 23, 2015

thanks

@iampoul

This comment has been minimized.

Copy link

@iampoul iampoul commented Feb 26, 2015

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

@PhilipTang

This comment has been minimized.

Copy link

@PhilipTang PhilipTang commented Mar 7, 2015

ไนˆไนˆๅ“’~

@aguidis

This comment has been minimized.

Copy link

@aguidis aguidis commented Mar 18, 2015

nice thanks

@igregson

This comment has been minimized.

Copy link

@igregson igregson commented Apr 4, 2015

nearly 2 years later, this approach still works.

many thanks :)

@yetithefoot

This comment has been minimized.

Copy link

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

@adiazpy adiazpy commented May 6, 2015

Great! Also works on Raspberry Pi 2

@sadfuzzy

This comment has been minimized.

Copy link

@sadfuzzy sadfuzzy commented May 7, 2015

thanks a lot! ๐Ÿ‘

@juddflamm

This comment has been minimized.

Copy link

@juddflamm juddflamm commented May 11, 2015

Thanks!

@fes300

This comment has been minimized.

Copy link

@fes300 fes300 commented Jun 7, 2015

thanks, been on that for a while

@brunojppb

This comment has been minimized.

Copy link

@brunojppb brunojppb commented Jun 15, 2015

Thank you! Thumbs up!!!

@mhipo1364

This comment has been minimized.

Copy link

@mhipo1364 mhipo1364 commented Jul 30, 2015

Thanks ๐Ÿ‘

@erinwan

This comment has been minimized.

Copy link

@erinwan erinwan commented Aug 2, 2015

Thank you!

@chrismipi

This comment has been minimized.

Copy link

@chrismipi chrismipi commented Sep 15, 2015

Thanks

@maciao

This comment has been minimized.

Copy link

@maciao maciao commented Sep 28, 2015

love you ! !!!

@abelkov

This comment has been minimized.

Copy link

@abelkov abelkov commented Oct 3, 2015

Awesome!

@xieweizhi

This comment has been minimized.

Copy link

@xieweizhi xieweizhi commented Nov 9, 2015

Thanks ๐Ÿ‘

@fisher

This comment has been minimized.

Copy link

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

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

@maciao maciao commented Dec 2, 2015

thanks & Love u <3 !!

@bboyairwreck

This comment has been minimized.

Copy link

@bboyairwreck bboyairwreck commented Dec 13, 2015

Thank you! Worked perfectly!

@yosvelquintero

This comment has been minimized.

Copy link

@yosvelquintero yosvelquintero commented Dec 22, 2015

Thanks!

@niallobrien

This comment has been minimized.

Copy link

@niallobrien niallobrien commented Jan 16, 2016

Thank you. :)

@mhipo1364

This comment has been minimized.

Copy link

@mhipo1364 mhipo1364 commented Feb 10, 2016

Cool, Thanks ๐Ÿ‘

@hackingsimplicity

This comment has been minimized.

Copy link

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

@Krijger Krijger commented Feb 12, 2016

Thanks for the nice Gist

@akhileshappala

This comment has been minimized.

Copy link

@akhileshappala akhileshappala commented Feb 21, 2016

Thanks

@rampatra

This comment has been minimized.

Copy link

@rampatra rampatra commented Feb 24, 2016

Worked like a charm, thanks a ton!

@danielcodes

This comment has been minimized.

Copy link

@danielcodes danielcodes commented Mar 1, 2016

Thanks!

@ozzieperez

This comment has been minimized.

Copy link

@ozzieperez ozzieperez commented Mar 5, 2016

Thanks!

@searchpcc

This comment has been minimized.

Copy link

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

@JunilJacob JunilJacob commented Mar 12, 2016

Thanks!

@adnnn

This comment has been minimized.

Copy link

@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

This comment has been minimized.

Copy link

@ruooooooli ruooooooli commented Mar 18, 2016

Thanks!!!

@fastCargo

This comment has been minimized.

Copy link

@fastCargo fastCargo commented Apr 4, 2016

@adnnn - this worked like a charm - thanks!

@vpakg

This comment has been minimized.

Copy link

@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

This comment has been minimized.

Copy link

@PangeranWeb PangeranWeb commented Apr 12, 2016

Thanks Captain !!!

@hasangilak

This comment has been minimized.

Copy link

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

@hector-cortez hector-cortez commented May 22, 2016

Thanks, works in Raspbian (Raspberry Pi)

@danilobjr

This comment has been minimized.

Copy link

@danilobjr danilobjr commented Jun 26, 2016

Oh man. It works! Thank you so much!

@rezayds

This comment has been minimized.

Copy link

@rezayds rezayds commented Jun 27, 2016

Thanks man!

@luizs81

This comment has been minimized.

Copy link

@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

This comment has been minimized.

Copy link

@kas kas commented Aug 3, 2016

Awesome! Thanks. Works on Ubuntu Mate 16.04.1

@Server4001

This comment has been minimized.

Copy link

@Server4001 Server4001 commented Aug 28, 2016

Works great!

@kemalyen

This comment has been minimized.

Copy link

@kemalyen kemalyen commented Sep 7, 2016

great job!

@dineshadepu

This comment has been minimized.

Copy link

@dineshadepu dineshadepu commented Sep 17, 2016

Thank you!

@kevinzzz007

This comment has been minimized.

Copy link

@kevinzzz007 kevinzzz007 commented Sep 17, 2016

Thanks!

@chaicko

This comment has been minimized.

Copy link

@chaicko chaicko commented Oct 3, 2016

Excellent!

@mentorkadriu

This comment has been minimized.

Copy link

@mentorkadriu mentorkadriu commented Oct 7, 2016

Thanks! Installed on Bash on Ubuntu on Windows

@yar00001

This comment has been minimized.

Copy link

@yar00001 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
fi
@1ur11

This comment has been minimized.

Copy link

@1ur11 1ur11 commented Oct 14, 2016

Thanks!

@BorisLevanov

This comment has been minimized.

Copy link

@BorisLevanov BorisLevanov commented Nov 18, 2016

Works like a charm! :)

@HereComesJuju

This comment has been minimized.

Copy link

@HereComesJuju HereComesJuju commented Jan 11, 2017

Many thanks ! Works perfectly !

@webysther

This comment has been minimized.

Copy link

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

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

@seanfealy seanfealy commented Feb 26, 2017

Worked like a charm. Thanks!

@pawel-miczka

This comment has been minimized.

Copy link

@pawel-miczka pawel-miczka commented Mar 6, 2017

How to rollback to "vanilla bash" :) ?

@joelcn

This comment has been minimized.

Copy link

@joelcn joelcn commented Mar 7, 2017

well done mate, nice tutorial, simple and useful

@waterlili

This comment has been minimized.

Copy link

@waterlili waterlili commented Mar 10, 2017

Thanks:)

@nosdoska

This comment has been minimized.

Copy link

@nosdoska nosdoska commented Apr 25, 2017

Thanks! Works in Ubuntu Gnome 17.04

@ghost

This comment has been minimized.

Copy link

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

@srebalaji srebalaji commented Jun 12, 2017

Good one. Thank you. ๐Ÿ‘

@deyvin

This comment has been minimized.

Copy link

@deyvin deyvin commented Jul 18, 2017

Thanks!

@Hepic

This comment has been minimized.

Copy link

@Hepic Hepic commented Sep 11, 2017

Thank you !

@amsheehan

This comment has been minimized.

Copy link

@amsheehan amsheehan commented Oct 22, 2017

Champion!

@dimpiax

This comment has been minimized.

Copy link

@dimpiax dimpiax commented Oct 23, 2017

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

@bin9003

This comment has been minimized.

Copy link

@bin9003 bin9003 commented Nov 11, 2017

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

@physhik

This comment has been minimized.

Copy link

@physhik physhik commented Nov 27, 2017

Thanks!

@webhat

This comment has been minimized.

Copy link

@webhat 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.

@mateusdotcc

This comment has been minimized.

Copy link

@mateusdotcc mateusdotcc commented Dec 11, 2017

Thanks ๐Ÿ‘

@Ahm4d-94

This comment has been minimized.

Copy link

@Ahm4d-94 Ahm4d-94 commented Jan 8, 2018

thanks bro ๐Ÿ‘

@li19860

This comment has been minimized.

Copy link

@li19860 li19860 commented Jan 11, 2018

thanks bro.

@sahota14

This comment has been minimized.

Copy link

@sahota14 sahota14 commented Jan 13, 2018

Thank you!

@aramatev

This comment has been minimized.

Copy link

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

@HCrane HCrane commented Feb 21, 2018

Thank you!

@lauragift21

This comment has been minimized.

Copy link

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

@saidziani saidziani commented Apr 10, 2018

Thanks a lot!

@jmau111

This comment has been minimized.

Copy link

@jmau111 jmau111 commented Apr 26, 2018

very nice and still useflul !!!

@DennisMufasa

This comment has been minimized.

Copy link

@DennisMufasa DennisMufasa commented May 7, 2018

worked like a charm!

@blueshell2017

This comment has been minimized.

Copy link

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

@gitpetrova gitpetrova commented Jul 26, 2018

thanks a lot!

@javiros

This comment has been minimized.

Copy link

@javiros javiros commented Aug 19, 2018

Fantastic! Thank you!!

@rishabhdeepsingh

This comment has been minimized.

Copy link

@rishabhdeepsingh rishabhdeepsingh commented Sep 7, 2018

Thanks a LOT Bro

@mariaanko

This comment has been minimized.

Copy link

@mariaanko mariaanko commented Sep 13, 2018

cheers!

@VenkateswaraT

This comment has been minimized.

Copy link

@VenkateswaraT VenkateswaraT commented Sep 26, 2018

Thank you

@Mr-Quinn

This comment has been minimized.

Copy link

@Mr-Quinn Mr-Quinn 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

@themoralpanda themoralpanda commented Nov 9, 2018

Thanks for the share :)

@franciscodara

This comment has been minimized.

Copy link

@franciscodara franciscodara commented Feb 24, 2019

Guys, how uninstall this tutor? Help me please!

@sinscary

This comment has been minimized.

Copy link

@sinscary sinscary commented Mar 19, 2019

Awesome man

@mrroot5

This comment has been minimized.

Copy link

@mrroot5 mrroot5 commented Apr 16, 2019

@ilhamdoanggg

This comment has been minimized.

Copy link

@ilhamdoanggg ilhamdoanggg commented Oct 9, 2019

some problem after a week not shutdown my pc
and than i restart it back to bash normal, i use ubuntu 18-04 anyway
and here sudo shutdown -r 0 very nice solving

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.