Apropos and whatis not working

Hi there!

I have recently noticed that the commands apropos and whatis are no longer returning a result for me on anything. However my man command seems to be working just fine.

If anyone knows how to fix this problem I would be very grateful!

Thanks, Andrew

Please post the screen context (command and result) for each of those commands.
This is mine

$ man efibootmgr

$ apropos efibootmgr
efibootmgr (8)       - change the UEFI Boot Manager configuration

$ whatis efibootmgr
efibootmgr (8)       - change the UEFI Boot Manager configuration

$ info efibootmgr

The ‘man’ and ‘info’ commands give the expected information.
The ‘whatis’ and ‘apropos’ commands also give the expected returns for me.

Welcome to the Fedoraproject @andyforrest

Can you pleas tell what DE you are using? Are you working with the Workstation alias Gnome Desktop?

What do the following commands give back:

➜  whereis apropos
apropos: /usr/bin/apropos /usr/share/man/man1/apropos.1.gz

~ 
➜  whereis whatis
whatis: /usr/bin/whatis /usr/share/man/man1/whatis.1.gz

The binary and the .gz files are there?

➜  ls -ahl /usr/bin/apropos
lrwxrwxrwx. 1 root root 25 mar 22  2022 /usr/bin/apropos -> /etc/alternatives/apropos

~ 
➜  ls -ahl /usr/bin/whatis
lrwxrwxrwx. 1 root root 24 mar 22  2022 /usr/bin/whatis -> /etc/alternatives/whatis

Hi Jeff, this is what I get from those commands:

[andrewforrest@fedora ~]$ man efibootmgr
[andrewforrest@fedora ~]$ apropos efibootmgr
efibootmgr: nothing appropriate.
[andrewforrest@fedora ~]$ whatis efibootmgr
efibootmgr: nothing appropriate.
[andrewforrest@fedora ~]$ info efibootmgr
[andrewforrest@fedora ~]$ 

I’m using gnome 43.2

Here is the output from those commands:

[andrewforrest@fedora ~]$ whereis apropos
apropos: /usr/bin/apropos /usr/share/man/man1/apropos.1.gz
[andrewforrest@fedora ~]$ whereis whatis
whatis: /usr/bin/whatis /usr/share/man/man1/whatis.1.gz
[andrewforrest@fedora ~]$ ls -ahl /usr/bin/apropos
lrwxrwxrwx. 1 root root 25 Nov  5 09:03 /usr/bin/apropos -> /etc/alternatives/apropos
[andrewforrest@fedora ~]$ ls -ahl /usr/bin/whatis
lrwxrwxrwx. 1 root root 24 Nov  5 09:03 /usr/bin/whatis -> /etc/alternatives/whatis

The interesting point is what /etc/alternatives/whatis is pointing to.

So run

[vek@newbox ~]$ alternatives --display man
man - status is manual.
 link currently points to /usr/bin/man.man-db
/usr/bin/man.man-db - priority 300
 follower apropos: /usr/bin/apropos.man-db
 follower whatis: /usr/bin/whatis.man-db
 follower makewhatis: (null)
 follower apropos.1.gz: /usr/share/man/man1/apropos.man-db.1.gz
 follower man.1.gz: /usr/share/man/man1/man.man-db.1.gz
 follower whatis.1.gz: /usr/share/man/man1/whatis.man-db.1.gz
 follower makewhatis.8.gz: (null)
/usr/bin/man.mandoc - priority 200
 follower apropos: /usr/bin/apropos.mandoc
 follower whatis: /usr/bin/whatis.mandoc
 follower makewhatis: /usr/sbin/makewhatis.mandoc
 follower apropos.1.gz: /usr/share/man/man1/apropos.mandoc.1.gz
 follower man.1.gz: /usr/share/man/man1/man.mandoc.1.gz
 follower whatis.1.gz: /usr/share/man/man1/whatis.mandoc.1.gz
 follower makewhatis.8.gz: /usr/share/man/man8/makewhatis.mandoc.8.gz
Current `best' version is /usr/bin/man.man-db.
[vek@newbox ~]$ 

I tested /usr/bin/whatis.mandoc and it didn’t work, whereas /usr/bin/whatis.man-db does. If you have two choises you can select which one you will be using by running sudo alternatives --config man

Being offline, just a weird guess: usually you need to run mkwhatis as root, which is usually scheduled to be run daily or once a week. Not sure if it the same with Fedora.

I’ve tried that out, seems like I only have one choice:

[andrewforrest@fedora ~]$ alternatives --display man
man - status is auto.
 link currently points to /usr/bin/man.man-db
/usr/bin/man.man-db - priority 300
 follower apropos: /usr/bin/apropos.man-db
 follower whatis: /usr/bin/whatis.man-db
 follower man.1.gz: /usr/share/man/man1/man.man-db.1.gz
 follower apropos.1.gz: /usr/share/man/man1/apropos.man-db.1.gz
 follower whatis.1.gz: /usr/share/man/man1/whatis.man-db.1.gz
Current `best' version is /usr/bin/man.man-db.
[andrewforrest@fedora ~]$ sudo alternatives --config man
[sudo] password for andrewforrest: 

There is 1 program that provides 'man'.

  Selection    Command
-----------------------------------------------
*+ 1           /usr/bin/man.man-db

Enter to keep the current selection[+], or type selection number:

Try updating/rebuilding the man database.

First can you note the modified date of the database, in case we need to investigate further (e.g. find out if some package caused this issue):

$ stat /var/cache/man/index.db

Then, update the database:

$ sudo mandb

Check if that resolves the issue. if it doesn’t, force the database to be recreated from scratch (may take a while):

$ sudo mandb --create

makewhatis is specific to mandoc. Most modern distros use man-db by default, not mandoc.

man-db’s apropos and whatis use the same database, handled by mandb.

In Fedora, mandb update is automatically triggered by dnf transactions involving packages that contain man files, so there’s no need for scheduled updates (for typical users who aren’t installing/editing manpages outside of distro packages).

Interesting, seems like index.db doesn’t exist:

[andrewforrest@fedora ~]$ stat /var/cache/man/index.db
stat: cannot statx '/var/cache/man/index.db': No such file or directory

Should I proceed with updating the database?

That is strange. But you can proceed with mandb, it will create the db if it doesn’t exist:

$ sudo mandb

This is Fedora 37 Workstation or something else?

That’s it working now, thanks for your help!

Yeah running Fedora Linux 37 (Workstation Edition) x86_64

1 Like