Can not root: after removing ZSH and returning to default bash











up vote
0
down vote

favorite












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?










share|improve this question






















  • 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 at 20:47








  • 2




    Possible duplicate of How to change to bash shell? - Error
    – wjandrea
    Nov 12 at 21:02















up vote
0
down vote

favorite












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?










share|improve this question






















  • 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 at 20:47








  • 2




    Possible duplicate of How to change to bash shell? - Error
    – wjandrea
    Nov 12 at 21:02













up vote
0
down vote

favorite









up vote
0
down vote

favorite











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?










share|improve this question













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?







bash root zsh su






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 12 at 1:25









Jacob D'Costa

12




12












  • 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 at 20:47








  • 2




    Possible duplicate of How to change to bash shell? - Error
    – wjandrea
    Nov 12 at 21:02


















  • 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 at 20:47








  • 2




    Possible duplicate of How to change to bash shell? - Error
    – wjandrea
    Nov 12 at 21:02
















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 at 20:47






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 at 20:47






2




2




Possible duplicate of How to change to bash shell? - Error
– wjandrea
Nov 12 at 21:02




Possible duplicate of How to change to bash shell? - Error
– wjandrea
Nov 12 at 21:02










1 Answer
1






active

oldest

votes

















up vote
-2
down vote













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.






share|improve this answer























  • Don't re-link /bin/sh! It shouldn't break anything, but /bin/sh is meant to be Dash. Everything else in this answer is fine tho.
    – wjandrea
    Nov 12 at 20:50













Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1092096%2fcan-not-root-after-removing-zsh-and-returning-to-default-bash%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
-2
down vote













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.






share|improve this answer























  • Don't re-link /bin/sh! It shouldn't break anything, but /bin/sh is meant to be Dash. Everything else in this answer is fine tho.
    – wjandrea
    Nov 12 at 20:50

















up vote
-2
down vote













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.






share|improve this answer























  • Don't re-link /bin/sh! It shouldn't break anything, but /bin/sh is meant to be Dash. Everything else in this answer is fine tho.
    – wjandrea
    Nov 12 at 20:50















up vote
-2
down vote










up vote
-2
down vote









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.






share|improve this answer














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.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 12 at 20:58









wjandrea

7,70642258




7,70642258










answered Nov 12 at 1:34









Jacob D'Costa

12




12












  • Don't re-link /bin/sh! It shouldn't break anything, but /bin/sh is meant to be Dash. Everything else in this answer is fine tho.
    – wjandrea
    Nov 12 at 20:50




















  • Don't re-link /bin/sh! It shouldn't break anything, but /bin/sh is meant to be Dash. Everything else in this answer is fine tho.
    – wjandrea
    Nov 12 at 20:50


















Don't re-link /bin/sh! It shouldn't break anything, but /bin/sh is meant to be Dash. Everything else in this answer is fine tho.
– wjandrea
Nov 12 at 20:50






Don't re-link /bin/sh! It shouldn't break anything, but /bin/sh is meant to be Dash. Everything else in this answer is fine tho.
– wjandrea
Nov 12 at 20:50




















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1092096%2fcan-not-root-after-removing-zsh-and-returning-to-default-bash%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents