admin管理员组

文章数量:1534875

问题描述:

当尝试使用whatis ls时,提示:ls:nothing appropriate 。

[root@haojin ~]# whatis man
man: nothing appropriate.
[root@haojin ~]# whatis ls
ls: nothing appropriate.
[root@haojin ~]# whatis wc
wc: nothing appropriate.

如下图

原因分析:

问度娘才知道,原来whatis是根据数据库执行查找操作的,这个数据库是定期更新的,新安装的系统,系统还未自动更新,所以可以使用makewhatis手动更新,再次运行whatis ls,可以成功使用了。要有root权限才能使用makewhatis.

解决方案:

[root@haojin ~]# makewhatis
bash: makewhatis: command not found...
Install package 'mandoc' to provide command 'makewhatis'? [N/y] y


 * Waiting in queue... 
 * Loading list of packages.... 
The following packages have to be installed:
 mandoc-1.14.5-12.el8.x86_64	A suite of tools for compiling mdoc and man
Proceed with changes? [N/y] y


 * Waiting in queue... 
 * Waiting for authentication... 
 * Waiting in queue... 
 * Loading list of packages.... 
 * Requesting data... 
 * Testing changes... Failed to install packages: Error running transaction: file /usr/share/man/man7/mdoc.7.gz from install of mandoc-1.14.5-12.el8.x86_64 conflicts with file from package man-pages-4.15-6.el8.x86_64
[root@haojin ~]# whereis makewhatis
makewhatis:
[root@haojin ~]# whereis whatis
whatis: /usr/bin/whatis /usr/share/man/man1/whatis.1.gz


[root@haojin ~]# whatis ls
ls (1)               - list directory contents
ls (1p)              - list directory contents
[root@haojin ~]# whatis file
file (1)             - determine file type
file (1p)            - determine file type
[root@haojin ~]# whatis wc
wc (1)               - print newline, word, and byte counts for each file
wc (1p)              - word, line, and byte or character count

本文标签: 命令提示whatis