As pointed out by R. S, the CentOS official Docker images have manual page installation disabled. This is true also of the Fedora official Docker images.
The easiest way to handle this is via the following sed
command, which will work on either system:
sed -i -e '/tsflags=nodocs/s/^/#/' /etc/yum.conf /etc/dnf/dnf.conf || true
This will produce an error message saying it cannot read one of the two files, but whichever one does exist will be updated to comment out the tsflags=nodocs
line. The || true
at the end ensures that the command returns success regardless of any errors, to avoid halting in scripts.
This can be used in a RUN
command in a Dockerfile
, in which case you should use it before installing any further packages. For packages you already have installed any manual pages that normally come with them will remain uninstalled and the package will have to be re-installed to bring in the manual pages. Many of the base system's manual pages (such as ls
) are in the man-pages
package, but other packages, such as git
include their own manual pages and also need to be reinstalled.
Removing and then re-installing packages can create dependency problems. To avoid these instead use:
yum -y reinstall man-pages git
man(1)
is a very fundamental piece of the system. You could try to reinstall, i.e., goyum reinstall /usr/bin/man
. – vonbrand Dec 31 '15 at 23:01