Docker – debian:stretch-slim – install man and view manpages

Multi tool use
Multi tool use

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












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) ?










share|improve this question

























    up vote
    0
    down vote

    favorite












    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) ?










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      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) ?










      share|improve this question













      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) ?







      debian docker man






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 54 mins ago









      TachyonVortex

      19316




      19316




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          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:



          • Remove documentation to save hard drive space

          • Installing packages without docs

          • Reinstall man pages & fix man

          • How can I restore the man page for ls (/usr/share/man/man1/ls.1.gz)?





          share|improve this answer




















            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f480459%2fdocker-debianstretch-slim-install-man-and-view-manpages%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            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:



            • Remove documentation to save hard drive space

            • Installing packages without docs

            • Reinstall man pages & fix man

            • How can I restore the man page for ls (/usr/share/man/man1/ls.1.gz)?





            share|improve this answer
























              up vote
              0
              down vote













              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:



              • Remove documentation to save hard drive space

              • Installing packages without docs

              • Reinstall man pages & fix man

              • How can I restore the man page for ls (/usr/share/man/man1/ls.1.gz)?





              share|improve this answer






















                up vote
                0
                down vote










                up vote
                0
                down vote









                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:



                • Remove documentation to save hard drive space

                • Installing packages without docs

                • Reinstall man pages & fix man

                • How can I restore the man page for ls (/usr/share/man/man1/ls.1.gz)?





                share|improve this answer












                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:



                • Remove documentation to save hard drive space

                • Installing packages without docs

                • Reinstall man pages & fix man

                • How can I restore the man page for ls (/usr/share/man/man1/ls.1.gz)?






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 54 mins ago









                TachyonVortex

                19316




                19316



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f480459%2fdocker-debianstretch-slim-install-man-and-view-manpages%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Jd8dXmO47o 7X,OVirq,9 Zlz1ciBbI 9Ax1Qxce0IGSphfx
                    7fDF,RCnfX,ufkupncIMlKwPNl JTFZjA0c5KThk7aMfKyfgzNxq4 wAoeYIagrxUuz 3,l6jZwbVu8T,uC3MSOnz

                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    How many registers does an x86_64 CPU actually have?

                    Displaying single band from multi-band raster using QGIS