当手册页不可用时,请参阅“man 7 undocumented”以获取帮助 - WSL 核心 Ubuntu 18.04 安装

当手册页不可用时,请参阅“man 7 undocumented”以获取帮助 - WSL 核心 Ubuntu 18.04 安装

我在 win10 上使用 WSL离线运行分配管理实用程序。我的发行版是 Ubuntu 18.04 核心安装,可以在这里找到 -下载链接

键入man man, man pwdorman <anything>会产生以下结果:

No manual entry for man
See 'man 7 undocumented' for help when manual pages are not available.

以下是我尝试过的一些命令:

$ sudo mandb
Purging old database entries in /usr/share/man...
Processing manual pages under /usr/share/man...
Purging old database entries in /usr/share/man/cs...
Processing manual pages under /usr/share/man/cs...
Purging old database entries in /usr/share/man/da...
Processing manual pages under /usr/share/man/da...
...
0 man subdirectories contained newer manual pages.
0 manual pages were added.
0 stray cats were added.
0 old database entries were purged.


$ sudo mandb -t   */ output here certainly looks suspicious /*
mandb: warning: /usr/share/man/man1/sh.1.gz is a dangling symlink
mandb: warning: can't update index cache /var/cache/man/index.db: Resource temporarily unavailable
mandb: warning: can't update index cache /var/cache/man/cs/index.db: Resource temporarily unavailable
mandb: warning: can't update index cache /var/cache/man/da/index.db: Resource temporarily unavailable
mandb: warning: can't update index cache /var/cache/man/de/index.db: Resource temporarily unavailable
...


$ dpkg -l | grep -i manpages
ii  manpages                    4.15-1                            all          Manual pages about using a GNU/Linux system
ii  manpages-dev                4.15-1                            all          Manual pages about using GNU/Linux for development
ii  manpages-posix              2013a-2                           all          Manual pages about using POSIX system

我还检查了/usr/share/man文件夹,它们大多是空的(其他 manpath 文件夹完全是空的),除了一些损坏的符号链接:

$ manpath
/usr/local/man:/usr/local/share/man:/usr/share/man
$ cd /usr/share/man/man1
$ ls -alh
drwxr-xr-x 1 root root 4.0K Nov 27 18:16 .
drwxr-xr-x 1 root root 4.0K Sep 28 04:02 ..
lrwxrwxrwx 1 root root    9 Sep 28 04:00 sh.1.gz -> dash.1.gz
$ file sh.1.gz
sh.1.gz: broken symbolic link to dash.1.gz

然后我尝试将我找到的 man gzips 放在Ubuntu 联机帮助页网站进入 man1 文件夹,使其可以正常工作:

$ cd /usr/share/man/man1
$ ls -alh
drwxr-xr-x 1 root root 4.0K Nov 27 18:16 .
drwxr-xr-x 1 root root 4.0K Sep 28 04:02 ..
-rwxr-xr-x 1 root root 3.1K Nov 27 18:16 ls.1.gz <-- downloaded this one
lrwxrwxrwx 1 root root    9 Sep 28 04:00 sh.1.gz -> dash.1.gz
*/ 'man ls' works now /*

还尝试重新安装 mandb 和联机帮助页,但无济于事。

手动下载手册页文件可以解决问题,但必须有一些包或配置可以为我做到这一点。我该如何解决这个问题?

编辑1

$ head -n 1000 /etc/dpkg/dpkg.cfg /etc/dpkg/dpkg.cfg.d/*
==> /etc/dpkg/dpkg.cfg <==
# dpkg configuration file
#
# This file can contain default options for dpkg.  All command-line
# options are allowed.  Values can be specified by putting them after
# the option, separated by whitespace and/or an `=' sign.
#

# Do not enable debsig-verify by default; since the distribution is not using
# embedded signatures, debsig-verify would reject all packages.
no-debsig

# Log status changes and actions to a file.
log /var/log/dpkg.log

==> /etc/dpkg/dpkg.cfg.d/excludes <==
# Drop all man pages
path-exclude=/usr/share/man/*

# Drop all documentation ...
path-exclude=/usr/share/doc/*

# ... except copyright files ...
path-include=/usr/share/doc/*/copyright

# ... and Debian changelogs
path-include=/usr/share/doc/*/changelog.Debian.*

答案1

前两行/etc/dpkg/dpkg.cfg.d/excludes

# Drop all man pages
path-exclude=/usr/share/man/*

导致安装软件包时删除所有手册页。

要使手册页可用,您必须注释掉第二行:

# Drop all man pages
# path-exclude=/usr/share/man/*

然后重新安装您想要其手册页的任何软件包:

apt --reinstall install man-db coreutils

恢复manls手册页(等等)。

相关内容