我最近决定,由于我经常试验最新版本的nmap,所以最好在~/.nmap中保持SVN签出,而不安装并运行svn up; make来更新它。我将~/.nmap添加到$PATH中,并刚刚意识到通过这种设置,我不能再运行man nmap了。我在$MANPATH上读了一遍,意识到这似乎不适合我:
[14:51:28][~/.nmap]$ manpath
manpath: warning: $MANPATH set, prepending /etc/man_db.conf
/home/d/virtualenv/share/man:/usr/local/man:/usr/local/share/man:/usr/share/man:/usr/man:/home/d/.nmap/docs/man-xlate/:/home/d/.nmap/docs
[14:51:32][~/.nmap]$ strace man 1 nmap 2>&1 | egrep 'nmap.1|write'
stat("/home/d/.nmap/docs/zenmap.1", {st_mode=S_IFREG|0664, st_size=5943, ...}) = 0
stat("/home/d/.nmap/docs/nmap.1", {st_mode=S_IFREG|0664, st_size=183621, ...}) = 0
access("/usr/share/man/man1/nmap.1.gz", R_OK) = -1 ENOENT (No such file or directory)
write(2, "No manual entry for nmap in sect"..., 38No manual entry for nmap in section 1那是为什么,我怎样才能修好它?我注意到man也在~/.nmap/docs中查找一个名为index.db的文件,但找不到它,也许这是一条线索?
发布于 2015-06-01 14:34:05
问题是,docs目录没有man所需的目录结构(nmap.1应该位于man1子目录中),与使用-M选项时相同:
-M path, --manpath=path
Specify an alternate manpath to use. By default, man uses
manpath derived code to determine the path to search. This
option overrides the $MANPATH environment variable and
causes option -m to be ignored.
A path specified as a manpath must be the root of a manual
page hierarchy structured into sections as described in the
man-db manual (under "The manual page system"). To view
manual pages outside such hierarchies, see the -l option.使用make install时,手册将安装到正确的类别子目录中。因此,将MANPATH直接指向docs目录是行不通的。
https://stackoverflow.com/questions/30574036
复制相似问题