The Problem
I've installed Ubuntu 22.04 with minimized installation, then I "unmimized" it by executing sudo unminimize
. However, the man
package was not originally present and thus mandb-triggers for the originally installed packages were triggered.
That results in the following:
$ man ls
No manual entry for ls
$ man bash
No manual entry for bash
For some packages, that was worked-around by reinstalling them:
$ man curl
No manual entry for curl
$ sudo apt-get reinstall curl
<...>
$ man curl
# Works!
However, this is not the case for some utilities:
$ dpkg -S "$(which env)"
coreutils: /usr/bin/env
# Could be reinstalled with apt
$ dpkg -S "$(which bash)"
dpkg-query: no path found matching pattern /usr/bin/bash
Could not
Thus, I'm asking:
- Is there any option to add manpages for the system packages (such as
ls
,bash
, etc.) - If not, is there any option to force
dpkg
to process triggers for already installed package? I've seen an option to do so for.deb
files, but not for the already-installed ones.
Upd.1: "Non-package" programs and Unoptimal solution
/bin
and /usr/bin
Also, ls
and some other was provided by the package coreutils
, but there were present in both /bin/
and /usr/bin/
directories:
$ which ls
/usr/bin/ls
$ ll /usr/bin/ls
-rwxr-xr-x 1 root root 138208 Feb 7 16:03 /usr/bin/ls*
$ ll /bin/ls
-rwxr-xr-x 1 root root 138208 Feb 7 16:03 /bin/ls*
$ dpkg -L coreutils | grep /ls
/bin/ls
/usr/share/man/man1/ls.1.gz
The same was the case for the bash
package installing bash to /bin/bash
but PATH
finding it at /usr/bin/bash
Unoptimal solution
Well, I've managed to solve that issue by reinstalling every single package on the machine:
# WARNING: This will reinstall ALL EXISTING packages
$ apt list --installed 2>/dev/null | tail -n +2 | sed -E 's|^(.+)/.*$|\1|gm' | xargs sudo apt-get reinstall -y
That resulted in ~1h downloads and installations, kernel upgrade, and reboot, but the problem was eventually solved.
dpkg -S "$(which bash)"
is that/bin
is a symbolic link to/usr/bin
, and that the latter just happens to come earlier in the defaultPATH
. See for example Where does /usr/bin/grep come from in Ubuntu Focal – steeldriver May 25 '22 at 12:35