-1

During an offiline C programming exam, we only have access to a tarball of the latest man pages (https://mirrors.edge.kernel.org/pub/linux/docs/man-pages/).

The man pages installed on the system itself are outdated.

Is there a way to replace the systems current man pages with the given tar ball or make them more accessible, such that I can search through them and use less to read them?

sueszli
  • 97
  • 9
  • 2
    Questions about using your UNIX system's included tools are better suited for our sister site [unix.se]. Stack Overflow is only for questions about _writing code_ or tools exclusively for that purpose. – Charles Duffy Dec 13 '22 at 16:28

1 Answers1

0

You can just untar them and then point man at specific files. E.g:

$ cd man-pages-6.00
$ man man3/printf.3

This will open the man page in your pager.

You can also set the MANPATH environment variable to point to this location; then man will use it by default:

$ cd man-pages-6.00
$ export MANPATH=$PWD
$ man printf

This will replace the system man pages, so that running man for a command not included in the tar archive will fail:

$ man ls
No manual entry for ls

You can get the best of both worlds by telling man to search the unpacked tar archive first, and then search the system man pages:

$ cd man-pages-6.00
$ export MANPATH=$PWD:
$ man ls

That trailng : in MANPATH=$PWD: means "use the default path".

larsks
  • 277,717
  • 41
  • 399
  • 399
  • This is exactly what I was looking for. I didn't know that the man command hat this capability. Thank you! – sueszli Dec 13 '22 at 16:31