How to add/install man pages in Alpine Linux

When I type the ‘man ls‘ command in Alpine Linux, I get an error message: bash: man: command not found. How do I install and use man pages in Alpine Linux?

The man command used to display the on-line manual pages on Alpine Linux. The man page(s) may not be installed to save disk space, especially on Linux containers. Here is the quick and easy command option to install man command and man pages in Alpine Linux.
Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements Alpine Linux
Est. reading time 3 minutes

How to get man pages working in Alpine Linux

Type the following apk command to install man pages:
# apk add man man-pages
## NOTE: If you are using Alpine Linux 3.12 or above try ##
# apk add mandoc man-pages

Fig.01: Installing man pages in Alpine Linux with apk command

Fig.01: Installing man pages in Alpine Linux with apk command

Suggested command to get man pages installed on Alpine

# apk add man man-pages mdocml-apropos less less-doc
## NOTE: Alpine Linux 3.12 or above user try the following ##
# apk add mandoc man-pages mandoc-apropos less less-doc

Sample outputs:

(1/6) Installing less (551-r0)
(2/6) Installing less-doc (551-r0)
(3/6) Installing mdocml (1.14.3-r3)
(4/6) Installing man (1.14.3-r3)
(5/6) Installing man-pages (5.01-r0)
(6/6) Installing mdocml-apropos (1.14.3-r3)
Executing busybox-1.30.1-r2.trigger
Executing mdocml-apropos-1.14.3-r3.trigger
OK: 112 MiB in 95 packages

How to install missing man pages for specific package

Say, you installed bash on Alpine Linux or rsync command on Alpine Linux, and you need those man pages. Here is how to search and install those missing man pages:
# apk search rsync
# apk search bash
# apk add rsync-doc bash-doc


To display man page use the following simple syntax:
man command
man {section} command-name

Each man page comes in sections. The table below shows the section numbers of the manual followed by the types of pages they contain:

Table 1
Man page section Description
1 User command (executable programs or shell commands)
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
4 Special files (usually found in /dev)
5 File formats and conventions eg /etc/passwd
6 Games
7 Miscellaneous (including macro packages and conventions),
8 System administration commands (usually only for root user)
9 Kernel routines [Non standard]

For example, to display ls command man page, enter:
$ man ls
Let us see the password (/etc/passwd) file man page format from section # 5:
$ man 5 passwd
See how to install man pages on a Ubuntu Linux.

How do I search for man pages packages?

The above command only installs core man pages on Alpine Linux. Other packages typically may not include their man pages or other documentation. Those packages might provide an associated package that carries such stuff. For example, nginx server installed on Alpine but man page is not installed by default:
$ man nginx
Sample outputs:

man: No entry for nginx in the manual.

One can search for documentation package using the combination of apk command and grep command as follows:
apk search nginx | grep -- -doc
Sample outputs:


Now you can install nginx-doc package, run:
# apk add nginx-doc

(1/1) Installing nginx-doc (1.16.1-r0)
Executing mdocml-apropos-1.14.3-r3.trigger
OK: 112 MiB in 96 packages

Test it:
man nginx

How to set up PAGER variable to less or most or more

The command line syntax for bash/sh is:
export PAGER=less
OR if you have most command installed:
export PAGER=most
Make sure you add it to your shell config file (make sure you install bash shell on Alpine Linux or adjust settings as per your shell):
echo 'export PAGER=less' >> $HOME/.bashrc


This page explained how to install man pages in Alpine Linux. For more information, see the official project home page

This entry is 1 of 6 in the Installing and Using Man Pages Tutorial series. Keep reading the rest of the series:
  1. How to add/install man pages in Alpine Linux
  2. How to install man pages on a CentOS Linux 6/7
  3. Unix / Linux: Display Color Man Pages
  4. Linux / UNIX: Getting help with man pages and how to use them
  5. HowTo: Linux / UNIX Create a Manpage
  6. Ubuntu Linux install man pages

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 0 comments... add one

CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
0 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum