12

I have a minimal Centos 7 Docker image, and I'm trying to get some man pages on it to help in debugging my Dockerfile. Out of the box, it doesn't have much:

# man ls
No manual entry for ls

Per this Serverfault answer, I installed the man-pages RPM, and that seemed to go fine:

# 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!

However:

# man ls
No manual entry for ls

I used rpm to check that man-pages was supposed to include the ls man page, and it looks like it does:

# rpm -ql man-pages | grep -w ls
/usr/share/man/man1p/ls.1p.gz

But it doesn't look like it was actually installed:

# man 1p ls
No manual entry for ls in section 1p
# ls -l /usr/share/man/man1p/
total 0

And it doesn't seem to be anywhere else on the filesystem, either.

# find / -name ls.1\*
#

I can create files in /usr/share/man/man1p/, so it's probably not some Docker virtual filesystem weirdness.

The best part of this is that what I really wanted right this minute was the man page for the useradd command, which isn't even in that RPM. It's in 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

Which is already installed.

# 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

And, in fact, the binaries (e.g. /usr/sbin/useradd) are there. But not the man pages.

# ls -l /usr/share/man/man8/useradd.8.gz
ls: cannot access /usr/share/man/man8/useradd.8.gz: No such file or directory

So my questions are:

  1. Why can't I find any of the man pages that are supposed to be in the shadow-utils RPM, when I can find the binaries?
  2. Why doesn't (successfully) installing the man-pages RPM install the files that are supposed to be in that RPM?

Update: Per Aaron Marasco's answer and msuchy's comment, I tried yum reinstall shadow-utils. As with yum install man-pages, this appears to complete successfully, but doesn't actually put any files in /usr/share/man/.

  • similar question on a centos 6 docker imge: unix.stackexchange.com/questions/182500/no-manual-entry-for-man – maxschlepzig Mar 18 '16 at 10:38
  • Happened to me on a Vagrant setup with CentOS 7 - I found that some packages installed before the man-pages package was installed didn't have man pages. Solution was to reinstall such packages, e.g. yum reinstall yum rpm to cover those two. – RichVel Nov 7 '16 at 13:13
11

Your image probably has the nodocs transaction flag set in the yum configuration (cf. /etc/yum.conf).

You can remove it globally (or at the yum command line) before (re-)installing the packages you want the man pages for.

For example:

yum --setopt=tsflags='' reinstall shadow-utils
  • Should that be --setopt=tsflags='' as suggested in south-summit's answer? (= for -) – David Moles Apr 23 '17 at 18:14
  • 1
    @DavidMoles, yes, this was a typo - the correct switch syntax was also used in the referenced projectatomic document. – maxschlepzig Apr 23 '17 at 18:43
  • Thanks. I'd have just fixed it, but 6-character limit. :) – David Moles Apr 23 '17 at 18:45
  • why reinstall shadow-utils? – Tiina Apr 20 at 6:18
  • @Tina because this is the package that provides the command useradd (which was referenced in the question). – maxschlepzig Apr 20 at 7:45
4

Nothing here worked and on top of that the accepted answer contains a typo. I don't have enough Rep to comment there so I'm adding it here as an answer in case it helps anyone.

To install a package with man pages use:

yum --setopt=tsflags='' install man-db

Then:

yum --setopt=tsflags='' install {your-package-name}

Or, you can permanently remove the line from yum.conf which prevents man pages from installing. To do this, use:

sed -i '/tsflags=nodocs/d' /etc/yum.conf

Then you can use yum install or yum reinstall normally.

Source

  • +1 also, to just comment out the nodocs line, sed -i 's/tsflags=nodocs/# &/' /etc/yum.conf – michael May 16 '17 at 12:21
1

The Docker image is extremely stripped down. I believe they remove the man pages after the RPMs are installed. You can verify this with rpm -V shadow-utils. I know I've had problems trying to use delta RPMs to upgrade packages because the man pages are missing.

Sadly, I think the only way to get a man page for something would be to force reinstall the RPM or manually extract them from the RPM and drop them in place.

See also this site I guess.

  • 2
    Yes. yum reinstall shadow-utils will fix it. – msuchy Feb 3 '16 at 8:38
  • @msuchy I just tried that, and nope, it doesn't. Presumably related to whatever prevents man-pages from installing properly? – David Moles Feb 3 '16 at 19:04
  • @aaron-d-marasco That explains why they're not installed to begin with, but it doesn't explain what's going on when I try to install man-pages. – David Moles Feb 3 '16 at 19:04
1

I know this is an old question but given the time that I've spent tracking this, it will come in handy to someone else eventually.

The problem is related to the way RPM is configured in the docker image, first check to see if the excludedocs directive is listed in the configuration of RPM like so:

# rpm --showrc | grep docs

If it is in there then you must find the file that specifies it in my case it was under /etc/rpm/macros.imgcreate and remove it

Yum should then perform all man-page installation as expected (given that you don't also have the nodocs tsflag mentioned above.

-4
export MANPATH=/usr/share/man/fr
  • 5
    You should explain why you recommend this command. – Centimane Jan 2 '18 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.