Home Linux DistributionsAlpine Linux How To Install Man Pages In Alpine Linux
How To Install Man Pages In Alpine Linux

How To Install Man Pages In Alpine Linux

By sk
358 Views

Alpine Linux is known for its size. A minimal Docker image based on Alpine Linux with a complete package index is only 5 MB in size! It is no wonder why it is popular choice for many Linux power users and developers. It is so tiny compared to its counterparts, because many unwanted packages are stripped down to make Alpine Linux smaller. Even the manual pages for many command line utilities are not included by default in the Alpine docker images and vagrant boxes. This brief guide will walk you through the steps to install man pages in Alpine Linux.

Install Man Pages In Alpine Linux

To add or install man pages in Alpine Linux, run:

$ sudo apk add man man-pages mdocml-apropos less less-doc

Starting from Alpine Linux 3.12, the developers have changed the name of man package to mandoc. So if you are using version 3.12, run the following command to add manual pages:

$ sudo apk add mandoc man-pages less less-doc

Next, use your preferred PAGER to view the lengthy manual pages, page by page:

$ export PAGER=less

To make this permanent, add it to your ~/.bashrc file:

$ echo 'export PAGER=less' >> ~/.bashrc

Run the following command to take effect the changes:

$ source ~/.bashrc 

Now you can view the man pages of Linux commands in Alpine Linux system:

$ man uname

Due to its small footprint, the above installed packages will only add the core man pages. Still many other installed programs don't include their own man pages. Instead, they provide an associate package that contains the man pages.

For instance, let us try to display curl man page:

$ man curl
man: No entry for curl in the manual.

See? The man page for curl is not included even though we already have added the packages that provides man pages.

You can find which package provides the documentation for a given package using apk command and grep command like below:

$ apk search curl | grep ^curl

Sample output:

curl-7.69.1-r3
curl-dev-7.69.1-r3
curl-dbg-7.69.1-r3
curl-static-7.69.1-r3
curl-doc-7.69.1-r3
Find which package provides curl command man page
Find which package provides curl command man page

As you can see in the above output, the curl-doc package will add the documentation to the curl command. So let us install it using command:

$ sudo apk add curl-doc

Now you can display the man page of curl command:

$ man curl
Display curl command man page
Display curl command man page

Let us search for another command line utility, for example wget:

$ apk search wget | grep ^wget
wget-1.20.3-r1
wget-doc-1.20.3-r1
wgetpaste-2.29-r1
wgetpaste-zsh-completion-2.29-r1

As you see, the package that provides documentation for wget command is wget-doc. You need to install this package to view the man pages of wget command:

$ sudo apk add wget-doc

Hope this helps.

Related read:

You May Also Like

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More