How to install man pages on a CentOS Linux 6/7

in Categories , , , last updated November 16, 2017

I have installed both CentOS Linux version 6.x and 7.x using LXD vm. I am unable to access man pages and getting the following error:
    $ man date
    bash: man: command not found

How to install man pages on my CentOS 6/7 VM?

To install man pages use the yum command as follows on a CentOS 6/7. You must run command as the root user using the sudo command or su command.

Search for man pages

The syntax is:
$ sudo yum search man-pages
Sample outputs:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.excellmedia.net
 * epel: epel.mirror.net.in
 * extras: centos.excellmedia.net
 * updates: centos.excellmedia.net
============================================================================================= N/S Matched: man-pages ==============================================================================================
man-pages-fr.noarch : French version of the Linux man-pages
man-pages.noarch : Man (manual) pages from the Linux Documentation Project
man-pages-cs.noarch : Czech man pages from the Linux Documentation Project
man-pages-es.noarch : Spanish man pages from the Linux Documentation Project
man-pages-es-extra.noarch : Extra manual pages - Spanish versions
man-pages-it.noarch : Italian man (manual) pages from the Linux Documentation Project
man-pages-ja.noarch : Japanese man (manual) pages from the Japanese Manual Project
man-pages-ko.noarch : Korean(Hangul) Man(manual) Pages from the Korean Manpage Project
man-pages-overrides.noarch : Complementary and updated manual pages
man-pages-pl.noarch : Polish man pages from the Linux Documentation Project
man-pages-ru.noarch : Russian man pages from the Linux Documentation Project
man-pages-uk.noarch : Ukrainian man pages from the Linux Documentation Project
man-pages-zh-CN.noarch : Chinese Man Pages from Chinese Man Pages Project
 
  Name and summary matches only, use "search all" for everything.

How do I install man pages on a CentOS?

The syntax is as follows on CentOS 6:
$ sudo yum install man man-pages
Sample outputs:

Installing man pages
Installing man pages

The syntax is as follows on CentOS 7:
# yum install man-pages man-db man
Sample outputs:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.123host.vn
 * epel: repo.ugm.ac.id
 * extras: centos.excellmedia.net
 * updates: centos.excellmedia.net
Resolving Dependencies
--> Running transaction check
---> Package man-db.x86_64 0:2.6.3-9.el7 will be installed
--> Processing Dependency: libpipeline.so.1()(64bit) for package: man-db-2.6.3-9.el7.x86_64
---> Package man-pages.noarch 0:3.53-5.el7 will be installed
--> Running transaction check
---> Package libpipeline.x86_64 0:1.2.3-3.el7 will be installed
--> Finished Dependency Resolution
 
Dependencies Resolved
 
========================================================================================
 Package                Arch              Version                 Repository       Size
========================================================================================
Installing:
 man-db                 x86_64            2.6.3-9.el7             base            559 k
 man-pages              noarch            3.53-5.el7              base            5.0 M
Installing for dependencies:
 libpipeline            x86_64            1.2.3-3.el7             base             53 k
 
Transaction Summary
========================================================================================
Install  2 Packages (+1 Dependent package)
 
Total size: 5.6 M
Total download size: 5.6 M
Installed size: 6.5 M
Is this ok [y/d/N]: y 
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/2): man-db-2.6.3-9.el7.x86_64.rpm                             | 559 kB  00:00:02     
(2/2): man-pages-3.53-5.el7.noarch.rpm                           | 5.0 MB  00:00:12     
----------------------------------------------------------------------------------------
Total                                                      463 kB/s | 5.6 MB  00:12     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libpipeline-1.2.3-3.el7.x86_64                                       1/3 
  Installing : man-db-2.6.3-9.el7.x86_64                                            2/3 
  Installing : man-pages-3.53-5.el7.noarch                                          3/3 
  Verifying  : man-pages-3.53-5.el7.noarch                                          1/3 
  Verifying  : libpipeline-1.2.3-3.el7.x86_64                                       2/3 
  Verifying  : man-db-2.6.3-9.el7.x86_64                                            3/3 
 
Installed:
  man-db.x86_64 0:2.6.3-9.el7               man-pages.noarch 0:3.53-5.el7              
 
Dependency Installed:
  libpipeline.x86_64 0:1.2.3-3.el7                                                      
 
Complete!

See how to install man pages on a Ubuntu Linux.

How do I read man page for any command?

The syntax is as follows for the man command:
$ man command
$ man section command
$ man ls
$ man 8 useradd
$ man date

Sample outputs:

Man is an interface to the on-line reference manuals. Reading date comman man page.
Man is an interface to the on-line reference manuals. Reading date comman man page.

This entry is 2 of 5 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

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Share this on (or read 0 comments/add one below):