Man-pages trashed in LXC container

I have just installed F38 in an LXC container from https://images.linuxcontainers.org/ I’ve been a Fedora user since before it was branched off from RedHat.

man [anything] returns “No manual entry for [anything]”, so I presumed the base package was not installed, but dnf install man-pages said it was. mandb seems to work in the sense that it exits cleanly and does not report an error:

Purging old database entries in /usr/share/man…
Processing manual pages under /usr/share/man…
Updating index cache for path `/usr/share/man/man7’. Wait…done.
Checking for stray cats under /usr/share/man…
Checking for stray cats under /var/cache/man…
Purging old database entries in /usr/local/share/man…
Processing manual pages under /usr/local/share/man…
Checking for stray cats under /usr/local/share/man…
Checking for stray cats under /var/cache/man/local…
1 man subdirectory contained newer manual pages.
0 manual pages were added.
0 stray cats were added.
0 old database entries were purged.

There is almost nothing in /usr/share/man, eg. 6 entries in /usr/share/man/man1, most of which are from subsequently installed packages. But the strangest part is they are all symlinks to non-existent files in /etc/alternatives – sort of: Some of the paths do exists, but they are also symlinks, to paths in /usr/share/man. Eg:

> stat /usr/share/man/man1/man.1.gz
 File: /usr/share/man/man1/man.1.gz -> /etc/alternatives/man.1.gz
 [...]
> stat /etc/alternatives/man.1.gz
  File: /etc/alternatives/man.1.gz -> /usr/share/man/man1/man.man-db.1.gz

O_o

This includes pages subsequently installed from a package, so man-db or dnf or something seems to have done this.

Anyone have any idea how this happened?

Those images require to reinstall each package for which you want to read the man:

sudo dnf config-manager --save --setopt tsflags=
sudo dnf reinstall grep
man grep

Thanks much – I’ve never looked too hard into dnf configuration because it hasn’t caused me much grief before, but you inspired me to find the tsflags option in man dnf.conf, and the /etc/dnf/dnf.conf in the container did have tsflags=nodocs, so I removed that and ran reinstall on a few things including man and man-pages and voila.

Since each package that has its own man page is installed with the package, it would help to run a full reinstall – sudo dnf reinstall \* and let it process everything so all the missing man pages are installed for you. This may take some time but if done once then it is not needed again.

You may want to avoid that in the container and just use the man pages in the host instead.