0

I can not $ sudo su everytime, I enter the command, the terminal says :

can not execute /usr/bin/zsh no such file or directory

How to return to default bash of Ubuntu and make bash as default bash?

  • How did you install Zsh, and how did you remove it? What changes did you make to your setup while it was installed? What is the output of getent passwd root? Please edit to add. – wjandrea Nov 12 '18 at 20:47
  • 2
    Possible duplicate of How to change to bash shell? - Error – wjandrea Nov 12 '18 at 21:02
-2

First remove the symlink and make a new symlink that makes the default to previous bash

sudo ln -sv /bin/bash /bin/sh

Exit the terminal, and start a new terminal.

Now, change root's shell. Edit the passwd file - Start any editor and search for zsh.

I used vim - $ sudo vim /etc/passwd

Searched /zsh. For me it was on the first line:

root:x:0:0:root:/root:/usr/bin/zsh

changed

root:x:0:0:root:/root:/bin/bash

Esc, :wq, Enter - This is for saving and exiting Vim.

For other editors like gedit and nano, just search for zsh, edit line, then save and exit.

Then exit Bash and restart your PC.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.