webooru
webooru copied to clipboard
CentOS 8.0.1905 - 'chsh' : command not found - CentOS
Posts: 7
Joined: 2020/03/28 14:39:49
CentOS 8.0.1905 - 'chsh' : command not found
Hello All:
Thanks for reading.
I just tried to install 'zsh', but when I use the command 'chsh' to change the bash to 'zsh'($ chsh -s /bin/zsh), the bash showed me 'chsh : command not found'. And then I opened the folder '/etc/pam.d/' , I found that the command 'chsh' has gone.
I have compared the directory '/etc/pam.d/' of the Centos7 and CentOS8, it's really a big difference.
So, can any one tell me how to install the command 'chsh' on CentOS8? OR how can I fixit ?
Appreciate your goodness.
Regards.
Forum Moderator
Posts: 30853
Joined: 2009/09/24 10:40:56
Location: Brighton, UK
Re: CentOS 8.0.1905 - 'chsh' : command not found
Post by TrevorH » 2020/03/28 15:15:43
[root@centos8 ~]# dnf provides '*/chsh'
Last metadata expiration check: 0:51:14 ago on Sat Mar 28 14:23:21 2020.
util-linux-user-2.32.1-17.el8.x86_64 : libuser based util-linux utilities
Repo : BaseOS
Matched from:
Filename : /etc/pam.d/chsh
Filename : /usr/bin/chsh
Filename : /usr/share/bash-completion/completions/chsh
Is it installed?
Posts: 7
Joined: 2020/03/28 14:39:49
Re: CentOS 8.0.1905 - 'chsh' : command not found
Post by badapala » 2020/03/29 01:43:32
2020/03/28 15:15:43
[root@centos8 ~]# dnf provides '*/chsh'
Last metadata expiration check: 0:51:14 ago on Sat Mar 28 14:23:21 2020.
util-linux-user-2.32.1-17.el8.x86_64 : libuser based util-linux utilities
Repo : BaseOS
Matched from:
Filename : /etc/pam.d/chsh
Filename : /usr/bin/chsh
Filename : /usr/share/bash-completion/completions/chshIs it installed?
Thanks for reading.
I've tried to use the command'dnf search chsh', and it showed me'no match'.
I want to copy the 'chsh' from CentOS7 to 8, but I don't know how to do that.
Do you have some better ways to solve this problem?
Thank you.
Attachments
It's like this.
c1.png (11.61 KiB) Viewed 7419 times
Last edited by badapala on 2020/03/29 02:02:52, edited 1 time in total.
Posts: 7
Joined: 2020/03/28 14:39:49
Re: CentOS 8.0.1905 - 'chsh' : command not found
Post by badapala » 2020/03/29 01:58:15
2020/03/28 17:41:37
Note: Please run sudo dnf update to get 8.1-1911 content. There is only one supported CentOS 8 and at the moment it is 8.1-1911.
Thanks for reading, I've updated the version to 8.1-1991, but, I's still 'command not found'.
Do you know any way to download or install the 'chsh'?
Attachments
c1.png (3.55 KiB) Viewed 7418 times
Posts: 7
Joined: 2020/03/28 14:39:49
Re: CentOS 8.0.1905 - 'chsh' : command not found
Post by badapala » 2020/03/29 03:27:06
OK, guys , I found a way to change the default shell:
change the target user's bash shell to what you want.
But, I still want to know how to fix the 'chsh'.
If you know that, tell me , please. Thank you .
Regards.
Posts: 7
Joined: 2020/03/28 14:39:49
Re: CentOS 8.0.1905 - 'chsh' : command not found
Post by badapala » 2020/03/29 09:14:03
2020/03/29 08:48:08
Trevor did show that according to "dnf provides" the file "chsh" is in package "util-linux-user".
Therefore, you should
Thanks a lot . It works!
Really appreciate of that.
Could you tell me how doyou know that the package is 'util-linux-user'?
Posts: 3571
Joined: 2007/12/11 08:17:33
Location: Finland
Re: CentOS 8.0.1905 - 'chsh' : command not found
Post by jlehtone » 2020/03/29 09:53:01
How to read the output. Two examples:
Code: Select all
$ sudo dnf -q provides '*/fubar'
Error: No Matches found
No package in any of the enabled repositories provides file (or directory) with name "fubar".
Code: Select all
$ sudo dnf -q provides '*/chsh'
util-linux-user-2.32.1-17.el8.x86_64 : libuser based util-linux utilities
Repo : @System
Matched from:
Filename : /etc/pam.d/chsh
Filename : /usr/bin/chsh
Filename : /usr/share/bash-completion/completions/chsh
util-linux-user-2.32.1-17.el8.x86_64 : libuser based util-linux utilities
Repo : BaseOS
Matched from:
Filename : /etc/pam.d/chsh
Filename : /usr/bin/chsh
Filename : /usr/share/bash-completion/completions/chsh
Two packages are found that provide name "chsh". Both packages actually provide three such files:
/etc/pam.d/chsh, /usr/bin/chsh, /usr/share/bash-completion/completions/chsh
The name of both package is "util-linux-user", version "2.32.1-17.el8" and architecture "x86_64".
Why two of the same? They are copies in two different repositories: "System" and "BaseOS".
The "@" tells that this package is already installed and it was installed from "System", that is from the ISO image by OS installer.
Overall, the format of an entry in output is:
Code: Select all
<package> : <description>
Repo : <repository>
Matched from:
Filename : <path>