Skip to main content
Topic: apropos, man -k and mandb (Read 1409 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

apropos, man -k and mandb

I tried using man -k then apropos to find man pages, but nothing came up.   :(   pacman -Ql showed they should have given some results. But this was because I had never run mandb before. Some distros do this automatically when packages are installed, but apparently not here.
The fix was simple   :)  :
Code: [Select]
# mandb
It could be run as a cron job or just manually when you need it I suppose.

 

Re: apropos, man -k and mandb

Reply #1
I think an even better solution is to install a pacman hook to update it whenever needed:

$ cat /usr/share/libalpm/hooks/mandb-update.hook
[Trigger]
Type = File
Operation = Install
Operation = Upgrade
Operation = Remove
Target = usr/share/man/*

[Action]
Description = Updating manpage index cache...
When = PostTransaction
Exec = /usr/bin/mandb --quiet


(I did not figure out this on my own, but slightly modified the idea in mandb-ondemand aur package which is for systemd.)