Can't install man pages on minimal Centos Docker container
Solution 1
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
Solution 2
Nothing here worked for me, so I'm adding another 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.
Solution 3
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.
Solution 4
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.
Related videos on Youtube
David Moles
Updated on September 18, 2022Comments
-
David Moles over 1 year
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 thatman-pages
was supposed to include thels
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 inshadow-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:
- 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? - 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 withyum install man-pages
, this appears to complete successfully, but doesn't actually put any files in/usr/share/man/
. - Why can't I find any of the man pages that are supposed to be in the
-
msuchy about 8 yearsYes.
yum reinstall shadow-utils
will fix it. -
David Moles about 8 years@msuchy I just tried that, and nope, it doesn't. Presumably related to whatever prevents
man-pages
from installing properly? -
David Moles about 8 years@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
. -
michael almost 7 years+1 also, to just comment out the nodocs line,
sed -i 's/tsflags=nodocs/# &/' /etc/yum.conf