「whatis」コマンドが機能しないのはなぜですか?

「whatis」コマンドが機能しないのはなぜですか?

コマンドを実行すると、どのwhatisコマンドを渡しても「不適切」が出力されます。

$ whatis grep
grep: nothing appropriate.

出力whatis -d grep

From the config file /etc/manpath.config:
  Mandatory mandir `/usr/man'.
  Mandatory mandir `/usr/share/man'.
  Mandatory mandir `/usr/local/share/man'.
  Path `/bin' mapped to mandir `/usr/share/man'.
  Path `/usr/bin' mapped to mandir `/usr/share/man'.
  Path `/sbin' mapped to mandir `/usr/share/man'.
  Path `/usr/sbin' mapped to mandir `/usr/share/man'.
  Path `/usr/local/bin' mapped to mandir `/usr/local/man'.
  Path `/usr/local/bin' mapped to mandir `/usr/local/share/man'.
  Path `/usr/local/sbin' mapped to mandir `/usr/local/man'.
  Path `/usr/local/sbin' mapped to mandir `/usr/local/share/man'.
  Path `/usr/X11R6/bin' mapped to mandir `/usr/X11R6/man'.
  Path `/usr/bin/X11' mapped to mandir `/usr/X11R6/man'.
  Path `/usr/games' mapped to mandir `/usr/share/man'.
  Path `/opt/bin' mapped to mandir `/opt/man'.
  Path `/opt/sbin' mapped to mandir `/opt/man'.
  Global mandir `/usr/man', catdir `/var/cache/man/fsstnd'.
  Global mandir `/usr/share/man', catdir `/var/cache/man'.
  Global mandir `/usr/local/man', catdir `/var/cache/man/oldlocal'.
  Global mandir `/usr/local/share/man', catdir `/var/cache/man/local'.
  Global mandir `/usr/X11R6/man', catdir `/var/cache/man/X11R6'.
  Global mandir `/opt/man', catdir `/var/cache/man/opt'.
  Global mandir `/snap/man', catdir `/var/cache/man/snap'.
  Added sections: `1', `n', `l', `8', `3', `2', `3posix', `3pm', `3perl', `3am', `5', `4', `9', `6', `7'.
path directory /usr/local/sbin is in the config file
  adding /usr/local/man to manpath
  adding /usr/local/share/man to manpath
path directory /usr/local/bin is in the config file
path directory /usr/sbin is in the config file
  adding /usr/share/man to manpath
path directory /usr/bin is in the config file
path directory /sbin is in the config file
path directory /bin is in the config file
path directory /usr/games is in the config file
path directory /usr/local/games is not in the config file
adding mandatory man directories
warning: /usr/man: No such file or directory
add_nls_manpaths(): processing /usr/local/man:/usr/local/share/man:/usr/share/man
checking for locale en_US.UTF-8
adding /usr/local/man to manpathlist
adding /usr/share/man to manpathlist
final search path = /usr/local/man:/usr/share/man
path=/usr/local/man
warning: can't read the fallback whatis text database /usr/local/man/whatis
path=/usr/share/man
warning: can't read the fallback whatis text database /usr/share/man/whatis
grep: nothing appropriate.

この問題をどのように解決できますか?

ベストアンサー1

次のメッセージは、問題が何であるかを示します。

final search path = /usr/local/man:/usr/share/man
path=/usr/local/man
warning: can't read the fallback whatis text database /usr/local/man/whatis
path=/usr/share/man
warning: can't read the fallback whatis text database /usr/share/man/whatis
grep: nothing appropriate.

そして(使用するシステムによって読まなければならないマンページが異なります)が、例えば:

索引 データベースは検索中に使用され、 mandb プログラムによって更新されます。インストールによっては、通常のcronジョブとして実行するか、新しいマニュアルページをインストールしてから手動で実行する必要があります。相対索引データベースからレガシーテキスト Whatis データベースを作成するには、次のコマンドを実行します。

whatis -M manpath -w '*' | sort > manpath/whatis

どこmanpathマンページ階層です/usr/man

のファイルが見つからwhatisないか破損している可能性があります。これを再生成すると、問題が改善されます。/usr/local/man/usr/share/man

おすすめ記事