我只有一个最小的Centos 7 Docker映像,并且试图在其上获得一些手册页,以帮助调试Dockerfile。开箱即用,它没有太多:
# man ls
No manual entry for ls
根据Serverfault的这个答案,我安装了man-pages
RPM,看来一切正常:
# yum install -y man-pages
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: mirror.vtti.vt.edu
* extras: centos.mbni.med.umich.edu
* updates: centos.netnitco.net
Resolving Dependencies
--> Running transaction check
---> Package man-pages.noarch 0:3.53-5.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================================
Package Arch Version Repository Size
======================================================================================================
Installing:
man-pages noarch 3.53-5.el7 base 5.0 M
Transaction Summary
======================================================================================================
Install 1 Package
Total download size: 5.0 M
Installed size: 4.6 M
Downloading packages:
man-pages-3.53-5.el7.noarch.rpm | 5.0 MB 00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : man-pages-3.53-5.el7.noarch 1/1
Verifying : man-pages-3.53-5.el7.noarch 1/1
Installed:
man-pages.noarch 0:3.53-5.el7
Complete!
然而:
# man ls
No manual entry for ls
我曾经rpm
检查过man-pages
应该包含ls
手册页的内容,看起来像这样:
# rpm -ql man-pages | grep -w ls
/usr/share/man/man1p/ls.1p.gz
但它看起来并不像实际安装的那样:
# man 1p ls
No manual entry for ls in section 1p
# ls -l /usr/share/man/man1p/
total 0
而且似乎文件系统上也没有其他位置。
# find / -name ls.1\*
#
我可以在中创建文件/usr/share/man/man1p/
,因此可能不是某些Docker虚拟文件系统怪异。
最好的部分是,我这一刻真正想要的是该useradd
命令的手册页,即使在该RPM中也没有。在shadow-utils
。
# yum whatprovides /usr/share/man/man8/useradd.8.gz
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: mirror.vtti.vt.edu
* extras: mirror.tzulo.com
* updates: centos.netnitco.net
2:shadow-utils-4.1.5.1-18.el7.x86_64 : Utilities for managing accounts and shadow password files
Repo : base
Matched from:
Filename : /usr/share/man/man8/useradd.8.gz
已经安装了。
# yum install shadow-utils
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: mirror.vtti.vt.edu
* extras: centos.mbni.med.umich.edu
* updates: centos.netnitco.net
Package 2:shadow-utils-4.1.5.1-18.el7.x86_64 already installed and latest version
Nothing to do
而且,实际上,二进制文件(例如/usr/sbin/useradd
)在那里。但没有手册页。
# ls -l /usr/share/man/man8/useradd.8.gz
ls: cannot access /usr/share/man/man8/useradd.8.gz: No such file or directory
所以我的问题是:
shadow-utils
当我找到二进制文件时,为什么为什么找不到应该在RPM 中的手册页?- 为什么不(成功)安装
man-pages
RPM,安装应该在该RPM中的文件?
更新:我尝试了Per Aaron Marasco的回答和msuchy的评论yum reinstall shadow-utils
。与一样yum install man-pages
,此操作似乎已成功完成,但实际上并未将任何文件放入/usr/share/man/
。
man-pages
没有手册页。解决方案是重新安装此类软件包,例如yum reinstall yum rpm
覆盖这两个软件包。