What it does
man -k and apropos do not read every manual page; they search a small database with the short descriptions. mandb creates and updates that database.
On RHEL a timer updates it every day. But right after an install, or after you install new packages, the database can be empty or old. Then man -k says "nothing appropriate". Run mandb as root to fix it.
How to write it
mandb [-dqsucpt?V] [-C FILE] [MANPATH]
mandb [-dqsut] [-C FILE] -f FILENAME ...Options 12
Most used
Nothing matches this filter.
Examples 11
$ run as a normal user# run as root (or with sudo)
1Update the database
mandbTakes a few seconds. After this,
man -kfinds new pages.2Fix "nothing appropriate" from man -k
Typical on a fresh system or in the exam: build the database once.
3Build everything from zero
mandb -cUse it when the database seems broken.
4Update quietly in a script
mandb -qOnly errors are printed. Good after installing many packages.
5Update after you add your own man page
Your page appears in the search.
6Update only the entry of one file
mandb -f /usr/local/share/man/man8/mytool.8Faster than a full run.
7Build a database for your own pages (no root)
mandb -uFor pages in your home folder (for example in ~/.local/share/man).
8Check the pages for errors without changing anything
mandb -tReports broken or wrong pages.
9Check the timer that updates the database every day
If the timer is missing or disabled, the database gets old.
10Update the database after a big dnf install in a template
dnf install -y bind-utils nfs-utils && mandb -qA ready-to-use VM template should have a fresh man database.
11See which folders mandb indexes
manpathPrints the folders that man and mandb use.
Nothing matches this filter.
Watch out
mandbdoes not install man pages. If a page is missing, install the package that has it.- Run it as root to update the system databases.
Files
/var/cache/man/- The databases (index.db files).
/etc/man_db.conf- Which folders are indexed.
Tips to remember
- "nothing appropriate" →
sudo mandb→ tryman -kagain.