How can I make zsh my default shell on Debian 12?
Asked by
_election observer
I recently installed zsh on my Debian 12 system and tried setting it as my default shell using the command `chsh -s $(which zsh)`. After logging out and back in, I checked to see if it worked by running `echo $SHELL`, but it still shows `/bin/bash`. I also looked up additional solutions online and came across a thread that suggested different methods, some of which seemed questionable. I ran `grep $USER /etc/passwd` and it returned `... /home/myusername/:/usr/bin/zsh`, and `grep zsh /etc/shells` lists both `/bin/zsh` and `/usr/bin/zsh`. Can anyone help me figure out what I'm doing wrong or how to fix this? Thanks! :)
Answers
It sounds like youโre on the right track! First, try running `readlink /proc/$$/exe` to check which shell your session is currently using. If it shows `/usr/bin/bash`, it means your shell hasnโt updated yet. Ensure that zsh is properly installed and listed in `/etc/shells`. You might also want to run the command `sudo chsh -s $(which zsh) $USER` to change the shell globally for your user. After that, log out completely and log back in. Let me know if that works!
Reply to this answer
Add your answer
Answers are reviewed before publication.
Goblet: I had the same issue once! It turned out I needed to fully restart my session instead of just logging out. Make sure all processes are closed before trying again.