15

Note: This applies to Centos 7. If you are looking for a Debian answer, see this question. Those answers will not be duplicated here.

After an install of centos 7, I can't access man pages :

# man ls
-bash: man: command not found

I tried to install it via yum

# yum install man-pages
... ok

But again:

# man ls
-bash: man: command not found

Why?

  • 1
    This is extremely weird, as man(1) is a very fundamental piece of the system. You could try to reinstall, i.e., go yum reinstall /usr/bin/man. – vonbrand Dec 31 '15 at 23:01
17

In order to use the man command, you must also install the man package before or after the man-pages one

# yum install man-pages
... ok
# yum install man
... ok

Now man is installed

# man ls


NAME
      ls - list directory contents

SYNOPSIS
      ls [OPTION]... [FILE]...

DESCRIPTION
      List information about the FILEs (the current directory by default).  Sort entries alphabetically if none of -cftuvSUX nor --sort.

      Mandatory arguments to long options are mandatory for short options too. ...
  • 2
    Apparently this doesn't work on centOS inside a docker container. I know I've gotten this to work in a centOS VM, but unsure why its not working in the container. – jersey bean Jan 10 '18 at 21:07
  • 8
    Ok, I just found my answer. Docker centos images are prebuild with tsflags=nodocs set in /etc/yum.conf. See hub.docker.com/_/centos – jersey bean Jan 10 '18 at 22:26
  • Yes you're right! +1 for the complement. Thanks! – Rémi B. Jan 11 '18 at 13:34
2

The syntax on CentOS 7:

# yum install man-pages man-db man

The syntax on CentOS 6:

$ sudo yum install man man-pages

Source

0

I had the same problem in my docker container and solved it by commenting out the tsflags=nodocs in /etc/yum.conf file, then I removed the man-pages and man-db and reinstall them again. It works fine this way.

$ vi /etc/yum.conf

Search for tsflags into the file and add a comment (#) in front of it:

#tsflags=nodocs

Now remove the man-db and the man-pages if it's already installed on your system:

$ yum remove man-pages man-db

Then install them again:

$ yum install man-pages man-db

Sorted!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.