Ask Your Question
3

"chsh" Command is missing in Fedora 24 fresh install!

asked 2016-06-24 14:13:00 -0600

jvegas gravatar image

updated 2016-06-25 10:05:53 -0600

I have a fresh install of Fedora 24, with ZSH successfully installed. /etc/shells shows two instances of ZSH, both are valid.

When I try to do this:

chsh -s /usr/bin/zsh

The terminal returns:

zsh: error:command not found

What am I doing wrong?

edit retag flag offensive close merge delete

Comments

Welcome to ask.fedora. I'm not sure that you're doing anything wrong. Checking, I have zsh installed, but running chsh -l doesn't list it. It's possible that it can only use shells listed in /etc/shell and that you'd have to add it to the list, but I'd be very careful about doing that and be sure to back up the original file before making any changes. It's possible that this is a bug, either with the program or with the zsh package.

sideburns gravatar imagesideburns ( 2016-06-24 15:48:17 -0600 )edit

Thinking further, it almost looks like your shell (zsh, I presume) can't find chsh. Try using whereis chsh to make sure that it's installed as /usr/bin/chsh as it should be.

sideburns gravatar imagesideburns ( 2016-06-24 16:04:39 -0600 )edit

@sideburnschsh is indeed not installed. I have never experienced this with any Linux installation. How can I solve this? What I have done is modify Terminal preferences to run /usr/bin/zsh on start. That way I can at least use zsh.

jvegas gravatar imagejvegas ( 2016-06-24 20:12:06 -0600 )edit

@sideburns this is the result of whereis zsh and locate zsh

ron@Q500a Sat Jun 25 06:23:41pm
/home/ron> whereis chsh
chsh:
ron@Q500a Sat Jun 25 06:23:41pm
/home/ron> locate chsh
/usr/bin/lchsh
/usr/lib64/ladspa/am_pitchshift_1433.so
/usr/share/bash-completion/completions/_chsh
/usr/share/man/man1/lchsh.1.gz
/usr/share/zsh/5.2/functions/_chsh
jvegas gravatar imagejvegas ( 2016-06-25 18:27:35 -0600 )edit

That's very, very odd. Checking, chsh and lchsh seem to do the same thing, but the files have different sizes and modification dates. Try using ls -l /usr/bin/*chsh to see if the program simply isn't executable any more. On my system, its permissions are -rws--x--x.

sideburns gravatar imagesideburns ( 2016-06-25 19:53:02 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
4

answered 2016-06-24 22:34:17 -0600

jvegas gravatar image

updated 2016-06-29 10:21:03 -0600

To install chsh run the following command in Terminal:

sudo dnf install util-linux-user

To change the default shell to the shell of your choice, without using chsh, use

sudo lchsh -i your-user-id

The -i option makes lchsh interactive and it will respond with

Changing shell for ron.
New Shel[/pathto/current/shell]:  /pathto/new/shell    *## press enter to change shell*
Shell changed.  *## Response if change is accepted*

Alternatively, you can change the default shell to the shell of your choice, without using chsh, by using usermod. It is not the best way, but if your chsh or lchsh is not installed, then:

From Terminal

sudo usermod -s yourshell yourlogin

The only other alternative is far more risky and involves editing /etc/passwd, not recommended.

edit flag offensive delete link more

Comments

In F23 /usr/bin/chsh and /usr/bin/chfn were included in util-linux, but in F24 they have been moved to a separate package util-linux-user brobably because of their dependencies with libuser. Why this package is not automatically installed with the distribution is another question. I suppose it's a mistake and should be reported on Fedora Bugzilla as a packaging error.

jmt gravatar imagejmt ( 2016-06-29 17:08:12 -0600 )edit

I filed a Bugzilla report on this matter. https://bugzilla.redhat.com/show_bug....

jmt gravatar imagejmt ( 2016-06-29 17:29:47 -0600 )edit
-1

answered 2016-06-25 02:53:15 -0600

sideburns gravatar image

The chsh command is part of the util-linux package which contains a number of other important programs including fdisk. You can get it back by doing this:

sudo dnf reinstall util-linux

Good luck, and let us know how it works.

edit flag offensive delete link more

Comments

@sideburns Using sudo dnf reinstall util-linux did not recover chsh. I checked fdisk for man page to verify installation and fdisk is installed, but chsh is nowhere to be found. I have the zsh working and is selected in /etc/passwd correctly for my login. Still amazed that chsh is not installed!

jvegas gravatar imagejvegas ( 2016-06-25 09:58:57 -0600 )edit

I take it that you've tried whereis chsh to make sure it's not there. Alas, I don't have a box running F 24 to check this on. Maybe somebody who does can let us know if things have changed.

sideburns gravatar imagesideburns ( 2016-06-25 17:58:09 -0600 )edit

@sideburns There is a (new to me) command sudo lchsh -i which is an interactive way to change shell. It actually is more informative the chsh -s which usually executes without responding in terminal. lchsh -i shows the current and then asks for the new shell with complete path.

jvegas gravatar imagejvegas ( 2016-06-25 19:52:04 -0600 )edit

We were both posting at the same time, and as it happens, I mentioned lchsh; maybe you can just use it in the future?

sideburns gravatar imagesideburns ( 2016-06-25 19:55:56 -0600 )edit

@sideburns Finally found the package which installs chsh. Installed util-linux-user and /usr/bin/chsh is now installed. Found the answer on a post about "Rawhide" not installing all of the core shell commands.

jvegas gravatar imagejvegas ( 2016-06-29 10:13:08 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-06-24 14:13:00 -0600

Seen: 17,785 times

Last updated: Jun 29 '16