Old question: "Removed zsh, but forgot to change shell back to bash, and now Ubuntu crashes (wsl)" Note that @steeldriver's answer works for my new question as well.
I have been trying to install zsh on my Ubuntu terminal 20.04 (wsl). I changed the shell (using chsh
) to zsh, but then I removed zsh. Then I forgot to change the shell back to bash. Now Ubuntu crashes immediately after it's launched. How can I avoid that crash without an uninstall + reinstall?
wsl -u root
orwsl -d <distrib> -u root
if you have more than one distrib)? If so, you should be able tochsh
the user account from there. – steeldriver Feb 11 '21 at 01:58wsl -u root
and ranchsh -s $(which bash)
, but when I ran ubuntu, it didn't work. So yes, I could login to the "root account", but running the chsh didn't affect ubuntu.exe – crxyz Feb 11 '21 at 02:06chsh -s $(which bash)
will change root's default shell; to change a user's shell you would needchsh -s $(which bash) <username>
(where<username>
is replaced by the actual login name of your wsl user) – steeldriver Feb 11 '21 at 02:08