Artix Linux Forum

Artix Linux => Tutorials and HOWTOs => Topic started by: ####### on 11 August 2019, 03:21:58

Title: apropos, man -k and mandb
Post by: ####### on 11 August 2019, 03:21:58
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.
Title: Re: apropos, man -k and mandb
Post by: rmann on 11 April 2021, 16:15:39
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.)