CentOS – How to Find What Package Provides a Missing Man Page

centosman

At the bottom of man pcregrep, there is a message:

SEE ALSO

       pcrepattern(3), pcresyntax(3), pcretest(1).

However, when I try to view man pcresyntax I get:

$ man pcresyntax
No manual entry for pcresyntax
$ man 3 pcresyntax
No entry for pcresyntax in section 3 of the manual
$ man -k pcre
pcre-config          (1)  - program to return PCRE configuration
pcregrep             (1)  - a grep with Perl-compatible regular expressions
pcre_table           (5)  - format of Postfix PCRE tables
pcretest             (1)  - a program for testing Perl-compatible regular expressions

I tried yum info pcresyntax and even yum search pcresyntax and got nothing. At the suggestion of some comments posted below, I tried yum provides pcresyntax and yum whatprovides pcresyntax and got no results. (This box is running CentOS 6.6.)

What package includes the man page pcresyntax? More importantly, how can I find out what package includes a man page that I am missing?

(This is primarily for missing man pages that are mentioned in other man pages, rather than missing man pages for an installed command. In other words, man pages that are not obviously associated with a given command.)


NOTE: I work with Linux professionally and I am interested in broadly applicable answers, as well as answers specific to any of the major package managers. pcresyntax is just a specific example of a missing man page, not the end-all of my question.

Currently at work I primarily use yum, mostly on RHEL/CentOS 6, and I asked the title question rather than "where can I find the pcresyntax man page?" because I would like to know as much as possible about how to find and install missing man pages, for professional use both now (RHEL/CentOS) and in the future (Ubuntu/Debian, OpenSUSE, …?)

Since asking this question I also found the Stack Overflow Regular Expressions FAQ which answered all my immediate questions about PCRE. 😉

Best Answer

For the system using RPM (yum) package manager, for instance (here) CentOS, use yum provides or yum whatprovides:

provides or whatprovides
              Is used to find out which package provides some feature or
              file. Just use a specific name or a file-glob-syntax wildcards
              to list the packages available or installed that provide that
              feature or file.

For pcresyntax, you can try:

yum whatprovides "*/pcresyntax"

From RHL documentation,

yum provides "*/file_name" is a useful way to find the packages that contain file_name.

Also visit How do I find which rpm package supplies a file I'm looking for?


For Debian/Ubuntu based system which use APT as default package-manager, there is apt-file (thanks @Gilles for pointing out) command which can do a job what you're looking for.

DESCRIPTION
       apt-file is a command line tool for searching files in packages for the APT package management system.

search Search in which package a file is included. A list of all packages containing the  pattern  pattern  is returned.

So, use apt-file search to find a package that includes a file you're looking for.


In another words, manpage is provided by files (usually from /usr/share/man) and possible duplicate of How to find out which (not installed) package a file belongs to?!

Related Question