I've just installed zsh on Ubuntu 20.04 and decided to change it back to bash. I tried common way which is chsh
but it doesn't work.
Reference: changing shell from zsh to bash
Current shell
wolf@linux:/home/wolf $ echo $SHELL
/bin/zsh
wolf@linux:/home/wolf $
1st attempt
wolf@linux:/home/wolf $ sudo chsh -s /bin/bash
wolf@linux:/home/wolf $ echo $SHELL
/bin/zsh
wolf@linux:/home/wolf $
2nd attempt
wolf@linux:~$ sudo chsh --shell=/bin/bash $USER
wolf@linux:~$ echo $SHELL
/bin/zsh
wolf@linux:~$
3rd attempt
wolf@linux:~$ chsh -s $(which bash)
Password:
wolf@linux:~$ echo $SHELL
/bin/zsh
wolf@linux:~$
Even bash and exec bash do not work
wolf@linux:/home/wolf $ bash
wolf@linux:~$ echo $SHELL
/bin/zsh
wolf@linux:~$ exec bash
wolf@linux:~$ echo $SHELL
/bin/zsh
wolf@linux:~$
chsh
changes your default shell in the/etc/passwd
file. You can always just run/bin/bash
to go back tobash
for now. – Terrance Jan 02 '21 at 03:59exec bash
to replace the current shell with the command, in this case, the desired shell. It will destroy the previous shell process, thou. – Jun 23 '21 at 19:51