When using the debian:stretch Docker image, the /usr/share/man/ directory already contains many manpages, and man can be easily installed to view them:

$ apt-get update
$ apt-get install man
$ man ls
$ man cp

However, when using the debian:stretch-slim Docker image, the /usr/share/man/ directory is intentionally empty:

These tags are an experiment in providing a slimmer base (removing some extra files that are normally not necessary within containers, such as man pages and documentation)

How do I populate the /usr/share/man/ directory, so I can use man to view manpages for core utilities (such as cat, chmod, chown, cp, ls, mkdir, mv, rm, tail, etc) ?

2 Answers 2


The coreutils package populates the /usr/share/man/man1/ directory with manpages for core utilities.

However, simply running apt-get update and apt-get install coreutils is not sufficient, because dpkg has been configured to exclude /usr/share/man/*, using path-exclude in /etc/dpkg/dpkg.cfg.d/docker (see here and here).

So the first step is to remove that line from the /etc/dpkg/dpkg.cfg.d/docker file. One way to do this is by using sed:

$ sed -i '/path-exclude \/usr\/share\/man/d' /etc/dpkg/dpkg.cfg.d/docker

dpkg has also been configured to exclude /usr/share/groff/*, and this needs to be undone too (since groff is required in order to render manpages):

$ sed -i '/path-exclude \/usr\/share\/groff/d' /etc/dpkg/dpkg.cfg.d/docker

Now the /usr/share/man/man1/ directory needs to be populated from the coreutils package. Since coreutils is already installed in the debian:stretch-slim Docker image, it needs to be reinstalled:

$ apt-get update
$ apt-get install --reinstall coreutils

Finally, man can be installed and manpages can be viewed:

$ apt-get install man
$ man ls
$ man cp

It's also helpful to install less, which man will use for paginating the manpages, and provides a better experience than the default more paginator:

$ apt-get install less

Related questions:

  • With current Debian Stretch you need to install man-db instead of man.
    – FibreFoX
    Apr 20, 2021 at 22:03

If you want man-pages included do not use the

debian:stretch-slim version,

instead go for the regular


The man-intentionally to save diskspace in the slim-version.

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.