Apropos: Difference between revisions

imported>Jtojnar
updated with a command that works for me
Pigs (talk | contribs)
m add category configuration
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
As of NixOS 18.09, <code>apropos</code> (and likely also <code>whatis</code>) does not find anything when run. This is because the Apropos database is not generated automatically.
By default as of NixOS 21.05, <code>apropos</code>, <code>whatis</code> and <code>man -k</code> do not find anything when run, because the man page index cache is not generated.  


To generate it manually (and again to update it when new software is installed), run:
To generate it manually (and again to update it when new software is installed), run:
<syntaxhighlight lang=bash>
<syntaxhighlight lang="console">
sudo mkdir -p /var/cache/man/nixos
$ sudo mkdir -p /var/cache/man/nixos
sudo mandb
$ sudo mandb
</syntaxhighlight>
</syntaxhighlight>


To enable automatically building the immutable cache, you can set in your system configuration:
<syntaxhighlight lang="nix">
{
  documentation.man.generateCaches = true;
}
</syntaxhighlight>
Note that this will rebuild the cache every time you change anything in <code>environment.systemPackages</code>, and will make the <code>mandb</code> command fail.


For more information, see:
[[Category:Configuration]]
* {{issue|14472|Make NixOS module to update apropos database}}
* {{pull|18521|mandb: fix apropos}}