1

When I change a given manpage, apropos and whatis do only reflect these changes when I perform the following steps:

  1. store a copy of the manpage elsewhere and delete it in /usr/local/man/man1

  2. run makedb

  3. run makewhatis

  4. restore the manpage in /usr/local/man/man1

  5. run makedb

  6. run makewhatis

Details:

When I change the NAME section to contain a certain keyword which should be found by apropos, it will only be found by apropos after performing the six (!) steps described above.

It is definitely not sufficient, just to update with mandb and makewhatis. I know that I can recreate the whatis database by makewhatis -c, but an update process which requires the deletion of the database first, is somewhat weird.

Question:

How can I change a manpage and have this change reflected by apropos and whatis without the deletion/restore/update process?

1 Answer 1

1

How can I change a manpage and have this change reflected by apropos and whatis?

You should be using mandb - create or update the manual page index caches.

mandb is used to initialise or manually update index database caches. The caches contain information relevant to the current state of the manual page system and the information stored within them is used by the man-db utilities to enhance their speed and functionality.

mandb will update the databases uses by both apropos and whatis.

Source: mandb: create or update the manual page index caches - Linux Man Pages (8)

The database searched by apropos is updated by the mandb program. Depending on your installation, this may be run by a periodic cron job, or may need to be run manually after new manual pages have been installed.

Source apropos(1) - Linux manual page

Each manual page has a short description available within it. whatis searches the manual page names and displays the manual page descriptions of any name matched.

index databases are used during the search, and are updated by the mandb program. Depending on your installation, this may be run by a periodic cron job, or may need to be run manually after new manual pages have been installed.

Source: whatis(1) - Linux manual page

5
  • The process you explain in your answer is exactly what doesn't work for me. That's the reason for my question. I'm sorry if this wasn't explained clearly enough by me.
    – Rather Vi
    Commented Feb 20, 2022 at 15:55
  • @N.A.McBee What options did you give mandb and what was the exit status?
    – DavidPostill
    Commented Feb 20, 2022 at 16:31
  • @N.A.McBee did you try mandb -c? "This option forces mandb to delete previous databases and re-create them from scratch"
    – DavidPostill
    Commented Feb 20, 2022 at 16:32
  • I used mandb without options and tried out makewhatis -c. I still wonder why I should have to rebuild the whole database instead of just updating it with respect to a single new file version.
    – Rather Vi
    Commented Feb 20, 2022 at 17:10
  • The exit status of sudo mandb seems always to be 0.
    – Rather Vi
    Commented Feb 20, 2022 at 17:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .