-bash: man: command not found

在输入man命令的时候出现-bash: man: command not found


[root@linux ~]# man 5 passwd
-bash: man: command not found

经过前面的经验,认为可能是没有安装,为了证实猜测去百度了一下,百度给出的解释有两种:(1)没安装man;(2)path环境变量没配置,我选择一个一个试

[root@linux ~]# yum install man
已加载插件:fastestmirror
设置安装进程
Loading mirror speeds from cached hostfile
解决依赖关系
--> 执行事务检查
---> Package man.x86_64 0:1.6f-39.el6 will be 安装
--> 处理依赖关系 lzma,它被软件包 man-1.6f-39.el6.x86_64 需要
--> 执行事务检查
---> Package xz-lzma-compat.x86_64 0:4.999.9-0.5.beta.20091007git.el6 will be 安装
--> 处理依赖关系 xz = 4.999.9-0.5.beta.20091007git.el6,它被软件包 xz-lzma-compat-4.999.9-0.5.beta.20091007git.el6.x86_64 需要
--> 执行事务检查
---> Package xz.x86_64 0:4.999.9-0.5.beta.20091007git.el6 will be 安装
--> 完成依赖关系计算

依赖关系解决

================================================================================
 软件包            架构      版本                                 仓库     大小
================================================================================
正在安装:
 man               x86_64    1.6f-39.el6                          base    265 k
为依赖而安装:
 xz                x86_64    4.999.9-0.5.beta.20091007git.el6     base    137 k
 xz-lzma-compat    x86_64    4.999.9-0.5.beta.20091007git.el6     base     16 k

事务概要
================================================================================
Install       3 Package(s)

总下载量:418 k
Installed size: 887 k
确定吗?[y/N]:y
下载软件包:
(1/3): man-1.6f-39.el6.x86_64.rpm                        | 265 kB     00:00
(2/3): xz-4.999.9-0.5.beta.20091007git.el6.x86_64.rpm    | 137 kB     00:00
(3/3): xz-lzma-compat-4.999.9-0.5.beta.20091007git.el6.x |  16 kB     00:00
--------------------------------------------------------------------------------
总计                                             95 kB/s | 418 kB     00:04
运行 rpm_check_debug
执行事务测试
事务测试成功
执行事务
  正在安装   : xz-4.999.9-0.5.beta.20091007git.el6.x86_64                   1/3
  正在安装   : xz-lzma-compat-4.999.9-0.5.beta.20091007git.el6.x86_64       2/3
  正在安装   : man-1.6f-39.el6.x86_64                                       3/3
  Verifying  : xz-lzma-compat-4.999.9-0.5.beta.20091007git.el6.x86_64       1/3
  Verifying  : man-1.6f-39.el6.x86_64                                       2/3
  Verifying  : xz-4.999.9-0.5.beta.20091007git.el6.x86_64                   3/3

已安装:
  man.x86_64 0:1.6f-39.el6

作为依赖被安装:
  xz.x86_64 0:4.999.9-0.5.beta.20091007git.el6
  xz-lzma-compat.x86_64 0:4.999.9-0.5.beta.20091007git.el6

完毕!


安装完成之后,重新输入命令验证是否解决

[root@linux ~]# man 5 passwd
Cannot open the message catalog "man" for locale "zh_CN.UTF-8"
(NLSPATH="/usr/share/locale/%l/LC_MESSAGES/%N")

No entry for passwd in section 5 of the manual
[root@linux ~]# man
Cannot open the message catalog "man" for locale "zh_CN.UTF-8"
(NLSPATH="/usr/share/locale/%l/LC_MESSAGES/%N")

What manual page do you want?

还是不行,因为看到提示信息里面有open,所以没有直接尝试(2),选择继续去百度,百度给出的解释是没有安装man -pages,抱着试一试的心态继续操作安装man -pages

[root@linux ~]# yum -y install man man-pages
已加载插件:fastestmirror
设置安装进程
Loading mirror speeds from cached hostfile
包 man-1.6f-39.el6.x86_64 已安装并且是最新版本
解决依赖关系
--> 执行事务检查
---> Package man-pages.noarch 0:3.22-20.el6 will be 安装
--> 完成依赖关系计算

依赖关系解决

================================================================================
 软件包             架构            版本                    仓库           大小
================================================================================
正在安装:
 man-pages          noarch          3.22-20.el6             base          4.8 M

事务概要
================================================================================
Install       1 Package(s)

总下载量:4.8 M
Installed size: 4.3 M
下载软件包:
man-pages-3.22-20.el6.noarch.rpm                         | 4.8 MB     00:04
运行 rpm_check_debug
执行事务测试
事务测试成功
执行事务
  正在安装   : man-pages-3.22-20.el6.noarch                                 1/1
  Verifying  : man-pages-3.22-20.el6.noarch                                 1/1

已安装:
  man-pages.noarch 0:3.22-20.el6

完毕!

安装完毕之后再次输入命令验证是否解决

[root@linux ~]# man 5 passwd
Cannot open the message catalog "man" for locale "zh_CN.UTF-8"
(NLSPATH="/usr/share/locale/%l/LC_MESSAGES/%N")

Formatting page, please wait...
PASSWD(5)                  Linux Programmer’s Manual                 PASSWD(5)

NAME
       passwd - password file

DESCRIPTION
       Passwd  is  a text file, that contains a list of the system’s accounts,
       giving for each account some useful information like user ID, group ID,
       home  directory,  shell,  etc.   Often,  it also contains the encrypted
       passwords for each account.  It should  have  general  read  permission
       (many  utilities,  like ls(1) use it to map user IDs to usernames), but
       write access only for the superuser.

       In the good old days there was no great problem with this general  read
       permission.   Everybody  could  read  the  encrypted passwords, but the
       hardware was too slow to crack a well-chosen  password,  and  moreover,
       the  basic  assumption  used  to  be that of a friendly user-community.
       These days many people run some version of the shadow  password  suite,
       where  /etc/passwd  has  "x"  instead  of  encrypted passwords, and the
       encrypted passwords are in /etc/shadow which is readable by  the  supe-
       ruser only.

       If the encrypted password, whether in /etc/passwd or in /etc/shadow, is
       an empty string, login is allowed without even asking for  a  password.
       Note  that this functionality may be intentionally disabled in applica-
       tions, or configurable (for example  using  the  "nullok"  or  "nonull"
       arguments to pam_unix.so).

       If  the  encrypted  password  in  /etc/passwd  is  "*NP*"  (without the
       quotes), the shadow record should be obtained from a NIS+ server.
:

OK 搞定 嘻嘻~

**心得:**当你遇到问题的时候,分析-定位-解决这整个过程其实充满了探索与享受,of course,遇到的问题越多,个人的知识体系就会越完善,比直接看书,听别人讲解决的过程更为深刻,果然实践出真知啊——攀登者吖

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值