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
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
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:
- Learn To Use Man Pages Efficiently In Linux
- How To View A Specific Section In Man Pages In Linux
- Good Alternatives To Man Pages Every Linux User Needs To Know
- How To Find Longest Man Page In Linux
- How To Create And Maintain Your Own Man Pages
- How To Install Missing Man Pages Of Commands On Ubuntu
- Pinfo – A CLI Program To Read Info And Man Pages In Color