You are not logged in.

#1 2015-12-17 08:47:30

siddharth
Member
Registered: 2015-12-01
Posts: 2

su: failed to execute /bin/zsh: No such file or directory

I recently installed z shell and I made it my default shell by following the instructions  on Arch documentation.

Now, i uninstalled the z shell making bash as my default shell. Everything works fine except "su" command. I'm only able to use sudo <command>, but su throws this error : su: failed to execute /bin/zsh: No such file or directory.
What do I do know?

Offline

#2 2015-12-17 08:56:49

ayekat
Member
Registered: 2011-01-17
Posts: 1,392
Website

Re: su: failed to execute /bin/zsh: No such file or directory

Are you sure you haven't set /bin/zsh as the default shell for root?

getent passwd root

{,META,RE}PKGBUILDSpacman-hacks (includes makemetapkg and remakepkg) │ dotfiles

Online

#3 2015-12-17 10:03:26

Archforum101
Member
Registered: 2015-12-11
Posts: 44

Re: su: failed to execute /bin/zsh: No such file or directory

Just 2 cents, try "sudo su" and/or "sudo -i" either should make your sudo user root. Then check which shell root is using. "echo $SHELL". Would reread the Zsh section in Arch wiki. Looks like it's got all the relevant config files and their locations covered etc. Also occurs to me that if you did set Zsh as default shell for root user, might want to find any relevant files left over in roots home. My understanding that uninstalling/removing a package, doesn't generally remove whatever custom config files said package/app-etc installs in home. Though don't off the top even know if any are created in the systems root users /home directory for Zsh. Only a thought.

Also all hail the wonderous Arch wiki ! See this ? Haven't spent overmuch time playing with different user/system shells. It's been on the 2do list forever. Am sure you'll get this sorted out.

Last edited by Archforum101 (2015-12-17 10:13:29)

Offline

#4 2015-12-17 10:13:26

LCvanDinteren
Member
From: Netherlands
Registered: 2015-10-27
Posts: 153

Re: su: failed to execute /bin/zsh: No such file or directory

Easy, but perhaps slightly dirty, solution may be:

sudo pacman -S zsh
su 
chsh -s /bin/bash
exit
sudo pacman -Rs zsh

Offline

#5 2015-12-17 10:16:17

ayekat
Member
Registered: 2011-01-17
Posts: 1,392
Website

Re: su: failed to execute /bin/zsh: No such file or directory

Archforum101 wrote:

Also occurs to me that if you did set Zsh as default shell for root user, might want to find any relevant files left over in roots home. My understanding that uninstalling/removing a package, doesn't generally remove whatever custom config files said package/app-etc installs in home.

No package installs files to any home directory, and a user's shell is not defined in any of those files either (unless one does hair-raising things like setting `SHELL` manually or exec-ing another shell or whathever else).

As a little off-topic nit-picking, `sudo su` is pointless. You switch to root - and then you switch to root again.

LCvanDinteren wrote:

Easy, but perhaps slightly dirty, solution may be:

sudo pacman -S zsh
su 
chsh -s /bin/bash
exit
sudo pacman -Rs zsh

I'd rather go for a simple

sudo chsh -s /bin/bash root

But anyway, OP should first check whether the root user's shell is indeed set to /bin/zsh.

Last edited by ayekat (2015-12-17 10:19:20)


{,META,RE}PKGBUILDSpacman-hacks (includes makemetapkg and remakepkg) │ dotfiles

Online

#6 2015-12-17 10:24:56

siddharth
Member
Registered: 2015-12-01
Posts: 2

Re: su: failed to execute /bin/zsh: No such file or directory

Thanks a lot everyone, I didnt realize the solution was as simple as sudo chsh -s /bin/bash root smile

Offline

#7 2015-12-17 10:32:04

ayekat
Member
Registered: 2011-01-17
Posts: 1,392
Website

Re: su: failed to execute /bin/zsh: No such file or directory

You're welcome. And don't forget to mark your thread as solved by prepending [SOLVED] to your first post's title.

Oh, and - a little late - welcome on the Arch Linux forums! smile


{,META,RE}PKGBUILDSpacman-hacks (includes makemetapkg and remakepkg) │ dotfiles

Online

#8 2015-12-17 10:36:09

Archforum101
Member
Registered: 2015-12-11
Posts: 44

Re: su: failed to execute /bin/zsh: No such file or directory

^ Thanks for info ( was wondering about ~/user files, is good to know Arch doesn't do such w/o intervention ... and yeah point(s) taken/granted. smile

Think the sudo cmds to become root are still interesting and worth knowing regardless. In such event that say, "su" stops working or whatever. Not that it really matters. Glad the OP got things sorted out.

Last edited by Archforum101 (2015-12-17 10:39:04)

Offline

#9 2015-12-17 10:43:16

LCvanDinteren
Member
From: Netherlands
Registered: 2015-10-27
Posts: 153

Re: su: failed to execute /bin/zsh: No such file or directory

ayekat wrote:

I'd rather go for a simple

sudo chsh -s /bin/bash root

I had no knowledge of this simplicity smile

Last edited by LCvanDinteren (2015-12-17 10:43:30)

Offline

Board footer

Powered by FluxBB