I am trying to set ZSH as my default shell, however it keeps reverting back to bash.
I have tried this code:
sudo chsh -s $(<span class="hljs-built_in">which</span> zsh)
I’ve also tried:
sudo chsh -s /bin/zsh
Also tried these commands without sudo. Any ideas on what else I need to do. When running ZSH from within bash it loads up and works fine but I’d like to set it as the default shell.
bucks Answered question September 28, 2022
Just using chsh
:
chsh -s $(<span class="hljs-built_in">which</span> zsh)
without sudo
should work. If you use sudo
it will change the shell not for your working user but for root Finally, log out of your computer and log back in. Troubleshooting:
- Do you have zsh installed (ii)?
dpkg -l zsh
- Is your shell set to zsh? Last field of
grep $USER /etc/passwd
- Is Zsh a valid login shell?
grep zsh /etc/shells
bucks Edited answer September 28, 2022