I installed ZSH and didn't like it and I want to revert back to bash. I uninstalled ZSH before I tried changing the default shell. I uninstalled ZSH and then ran the commands chsh
and sudo chsh --shell=/bin/bash $USERNAME
but it seems that no matter what commands I use to change the shell it still says that I'm using the ZSH shell when I run echo $?
. I'm pretty new to Linux/Ubuntu so can someone point me in the right direction?
2 Answers
you can take a look at the list of shells you have installed with:
cat /etc/shells
For example, to change current shell to bash, you can use the chsh command :
chsh -s /bin/bash
or use the usermod command to change the shell of a user:
sudo usermod -s /bin/bash putHereTheUserName
You can confirm the sheel of the user on /etc/passwd (it's the last element of each line):
cat /etc/passwd | grep putHereTheUserName
Remove the old symlink first
sudo rm -v /bin/sh
Now, create a new symlink, assuming that bash
is in /bin
directory
sudo ln -sv /bin/bash /bin/sh
This should do the trick for you.
-
3
/bin/sh
on Ubuntu is supposed to point to/bin/dash
, and nobody uses/bin/sh
as their login shell. This bad advice, and unrelated to the problem at hand.– muruMay 22, 2016 at 23:36 -
@muru FYI on my Ubuntu
/bin/sh
is linked to/bin/bash
by default and it usesbash
as the default login shell. May 23, 2016 at 9:11 -
2Then you must have made it so. Ubuntu has used
/bin/dash
as/bin/sh
for years. FYI: wiki.ubuntu.com/DashAsBinSh And I said: nobody uses/bin/sh
as their login shell.– muruMay 23, 2016 at 9:13
/etc/passwd
only applies atlogin
time?