#897137 live-build: man -k and apropos don't work in live system

#897137#5
Date:
2018-04-28 22:37:10 UTC
From:
To:
In a live system built by live-build, "man -k" and apropos produce
no output except the message "<regexp>: nothing appropriate.", where
<regexp> is the argument that was given.

The cause is the command "rm -rf /var/cache/man/*" in
"/usr/share/live/build/hooks/normal/0190-remove-temporary-files.hook.chroot".

You can prevent the problem by doing the following before "lb config":

mkdir -p config/hooks/normal
cp -a /usr/share/live/build/hooks/normal/0190-remove-temporary-files.hook.chroot config/hooks/normal
patch config/hooks/normal/0190-remove-temporary-files.hook.chroot ~/Downloads/don-t-remove-man-page-database-cache.patch

(The patch is attached below).

######  Live System Information:  ######

    Name                          Version
===-=============================-===================
ii  live-boot                     1:20170112
ii  live-config                   5.20170112+deb9u1
ii  live-tools                    1:20151214+nmu1

Debian Release: 9.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-6-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE= (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

######  Host System Information:  ######

    Name                          Version
===-=============================-===================
ii  debootstrap                   1.0.89
ii  live-build                    1:20170213

Debian Release: 9.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-6-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE= (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

#897137#10
Date:
2019-12-19 17:55:36 UTC
From:
To:
Control: tag -1 - patch

While this fixes this feature, it bloats the image for a feature that is
seldom used.

I'm not sure that I want to apply your patch.

Cheers,

#897137#17
Date:
2019-12-27 00:19:36 UTC
From:
To:
Seldom used?  I think of apropos and man as the most fundamental
commands in the Unix ecosystem.  They are the first thing I mention,
when people ask me about learning (or mastering) the system.

Bloat?  The last live image I built occupies ~2215 MiB.  In it,
"tar czf - -C /var/cache/man . | wc -c" prints 421793, less than
one fiftieth of one percent of the image size.

In a smaller live image with fewer packages, the cost would be even
less than 0.4 MiB.