Skip to content

Install man page

Da (Derek) Kuang edited this page May 17, 2021 · 3 revisions

The minimal Ubuntu diverts the /user/bin/man to a fake binary file /usr/bin/man.REAL. So if the Dockerfile, we check if the file is diverted then we remove the file.

RUN if  [ "$(dpkg-divert --truename /usr/bin/man)" = "/usr/bin/man.REAL" ]; then \
        rm -f /usr/bin/man; \
        dpkg-divert --quiet --remove --rename /usr/bin/man; \
    fi

Then use sed to comment out the exclude rule

RUN sed -i 's,^path-exclude=/usr/share/man/,#path-exclude=/usr/share/man/,' /etc/dpkg/dpkg.cfg.d/excludes

Then we can install the manpages in docker-setup.sh.

apt-get install -y man man-db manpages-posix manpages-dev manpages-posix-dev

Acknowledgment

This page is mainly based on @hanjiexi's feedback on Piazza at 2021 Summer. Thank you for the great contribution.

Reference

Clone this wiki locally