How to rebuild the whatis database? whatis command spewing lots of garbage and interfering will other tools.
How can I update the whatis database?
$ sudo /usr/libexec/makewhatis
Password:
makewhatis: /usr/share/man/whatis.tmp: Read-only file system
I believe being able to update this database will solve some other issue I'm having. My path to discovery as follows...
I recently started noticing that fish shell completions were annoyingly slow on my machine, possibly shortly after upgrading to Catalina.
I did a little profiling with fish -d5 and noticed that the majority of the time was spent on the apropos command. I did some reading and learned that the tools apropos, whatis and makewhatis are all related. They index man pages and make them searchable. Fish shell is (correctly) using them to offer helpful completions.
When I run whatis or apropos standalone, I get the following output:
$ whatis man
hugo-gen-man(1) - Generate man pages for the Hugo CLI
groff_man(7) - groff `man' macros to support generation of man pages
groffer(1) - display groff files and man~pages on X and tty
man(1) - format and display the on-line manual pages
man.conf(5) - configuration data for man
zshall(1) - the Z shell meta-man page
xml2man(1) - MPGL to mdoc (man page) translator
makewhatis: /usr/lib/./libgutenprint.2.dylib: No such file or directory
makewhatis: /usr/lib/libsasl2.2.0.1.dylib: Not a directory
makewhatis: /usr/lib/libldap.dylib: Not a directory
makewhatis: /usr/lib/libsqlite3.0.dylib: Not a directory
makewhatis: /usr/lib/libcom_err.dylib: Not a directory
...
Followed by at least 100 more lines of the "Not a directory" messages. I believe it is all these useless lines that are slowing things down.
So I thought maybe I just need to rebuild the whatis database (perhaps after the Catalina upgrade?). However, it doesn't seem to work:
$ sudo /usr/libexec/makewhatis
Password:
makewhatis: /usr/share/man/whatis.tmp: Read-only file system
So this part is a little disturbing. How can I rebuild the whatis database? I have a hunch this will solve my issues if I can figure it out.
MacBook Pro 15”, macOS 10.15