最近升级后,man 停止工作,我不明白为什么。这是我的系统:
# cat /etc/*release*
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
这是我运行 man 时看到的内容 - 即一个空的手册页:
# man ksh
Manual page ksh(1) byte 0/0 (END) (press h for help or q to quit)
按下后q
:
man: command exited with status 1: (cd /usr/share/man && /usr/lib/man-db/zsoelim) | (cd /usr/share/man && /usr/lib/man-db/manconv -f UTF-8:ISO-8859-1 -t UTF-8//IGNORE) | (cd /usr/share/man && preconv -e UTF-8) | (cd /usr/share/man && tbl) | (cd /usr/share/man && nroff -mandoc -rLL=156n -rLT=156n -Tutf8)
strace
除了 stderr 的一些输出之外,我还没有真正找到任何内容:
# grep 'write(2' man.trc
10614 write(2, "troff: can't find 'DESC' file\n", 30) = 30
10614 write(2, "troff: fatal error: sorry, I can"..., 44) = 44
10599 write(2, "man: ", 5) = 5
10599 write(2, "command exited with status 1: (c"..., 299) = 299
10599 write(2, "\n", 1) = 1
#
# grep DESC man.trc
10613 openat(AT_FDCWD, "/usr/share/groff/site-font/devutf8/DESC", O_RDONLY) = -1 ENOENT (No such file or directory)
10613 openat(AT_FDCWD, "/usr/share/groff/1.22.4/font/devutf8/DESC", O_RDONLY) = 3
10614 openat(AT_FDCWD, "/usr/share/groff/site-font/devutf8/DESC", O_RDONLY) = -1 ENOENT (No such file or directory)
10614 openat(AT_FDCWD, "/usr/share/groff/1.22.4/font/devutf8/DESC", O_RDONLY) = -1 EACCES (Permission denied)
10614 openat(AT_FDCWD, "/usr/lib/font/devutf8/DESC", O_RDONLY) = -1 ENOENT (No such file or directory)
10614 write(2, "troff: can't find 'DESC' file\n", 30) = 30
我更改了权限/usr/share/groff/1.22.4/font/devutf8/DESC
以使世界可读,但这没有什么区别。
有任何想法吗?
编辑回应评论:
错误消息显示管道似乎失败:
# man zip
man: command exited with status 1: (cd /usr/share/man && /usr/lib/man-db/zsoelim) |
(cd /usr/share/man && /usr/lib/man-db/manconv -f UTF-8:ISO-8859-1 -t UTF-8//IGNORE) |
(cd /usr/share/man && preconv -e UTF-8) | (cd /usr/share/man && tbl) |
(cd /usr/share/man && nroff -mandoc -rLL=156n -rLT=156n -Tutf8)
我尝试手动运行它:
# gunzip -c /usr/share/man/man1/zip.1.gz | /usr/lib/man-db/zsoelim | /usr/lib/man-db/manconv -f UTF-8:ISO-8859-1 -t UTF-8//IGNORE | preconv -e UTF-8 | tbl | nroff -mandoc -rLL=156n -rLT=156n -Tutf8
它会产生正确的输出;所以无论发生什么问题都必须发生在该部分之前。据推测,它必须在某个地方解压缩联机帮助页并将其输入管道中,但我找不到它。
编辑2:
我又研究了一些 - 有趣的是:
# grep DESC man.trc
666097 openat(AT_FDCWD, "/usr/share/groff/site-font/devutf8/DESC", O_RDONLY) = -1 ENOENT (No such file or directory)
666097 openat(AT_FDCWD, "/usr/share/groff/1.22.4/font/devutf8/DESC", O_RDONLY) = 3
666098 openat(AT_FDCWD, "/usr/share/groff/site-font/devutf8/DESC", O_RDONLY) = -1 ENOENT (No such file or directory)
666098 openat(AT_FDCWD, "/usr/share/groff/1.22.4/font/devutf8/DESC", O_RDONLY) = -1 EACCES (Permission denied)
666098 openat(AT_FDCWD, "/usr/lib/font/devutf8/DESC", O_RDONLY) = -1 ENOENT (No such file or directory)
666098 write(2, "troff: can't find 'DESC' file\n", 30) = 30
所以,pid 666097 找到/usr/share/groff/1.22.4/font/devutf8/DESC
并成功打开它。然后pid 666098找到它,但是获取权限被拒绝。
这怎么可能?
答案1
显然,groff
找不到/usr/share/groff/site-font/devutf8/DESC
。据我了解,这应该是 的一部分groff-base
,因此指示您的评论sudo apt reinstall groff-base
似乎是有效的。
如果该目录/usr/share/groff/site-font/devutf8
不存在,则可能是
ln -s /usr/share/groff/current/font/devutf8 /usr/share/groff/site-font/devutf8
将帮助man
找到该DESC
文件。
如果该目录确实存在,但不包含,则从中DESC
复制可能会有所帮助。DESC
/usr/share/groff/current/font/devutf8
如果DESC
存在,请验证它是否可读 ( 644
)。