Instalei um servidor Ubuntu 22.04 LTS como uma instalação mínima e instalei os seguintes pacotes:
vim man-db manpages dialog bash-completion screen
Agora, quando executo man ls
, o Ubuntu está me pedindo para executar o unminimize
comando, embora os pacotes man já estejam instalados:
$ dpkg -l | egrep "man-db|manpages"
ii isc-dhcp-common 4.4.1-2.3ubuntu2.1 amd64 common manpages relevant to all of the isc-dhcp packages
ii man-db 2.10.2-1 amd64 tools for reading manual pages
ii manpages 5.10-1ubuntu1 all Manual pages about using a GNU/Linux system
E o diretório /usr/share/man/man1
está vazio:
$ ls /usr/share/man/man1
$ man -w ls
This system has been minimized by removing packages and content that are
not required on a system that users do not log into.
To restore this content, including manpages, you can run the 'unminimize'
command. You will still need to ensure the 'man-db' package is installed.
e mandb
saídas:
$ 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/id...
Processing manual pages under /usr/share/man/id...
...
Processing manual pages under /usr/local/man...
mandb: can't update index cache /var/cache/man/oldlocal/8087: No such file or directory
0 man subdirectories contained newer manual pages.
0 manual pages were added.
0 stray cats were added.
0 old database entries were purged.
$
O mais estranho é isso:
$ ls $(dpkg -L coreutils | grep man1/ls.1)
ls: cannot access '/usr/share/man/man1/ls.1.gz': No such file or directory
Encontrei isso:
$ dpkg -S bin/man
man-db: /usr/bin/manpath
local diversion from: /usr/bin/man
local diversion to: /usr/bin/man.REAL
man-db: /usr/bin/man
local diversion from: /usr/bin/man
local diversion to: /usr/bin/man.REAL
man-db: /usr/bin/mandb
man-db: /usr/bin/man-recode
$ head $(which man)
#!/bin/sh
echo "This system has been minimized by removing packages and content that are"
echo "not required on a system that users do not log into."
echo ""
echo "To restore this content, including manpages, you can run the 'unminimize'"
echo "command. You will still need to ensure the 'man-db' package is installed."
$ man.REAL -w ls
No manual entry for ls
Como isso pode ser resolvido sem ter que minimizar o Ubuntu?
O Ubuntu "minimizado" faz algumas regras em
/etc/dpkg/dpkg.cfg.d/excludes
, que incluem excluirman
e todas as páginas de manual de serem instaladas. Ele também muda oman
binário para um arquivo que gera a mensagem que você viu sobre um Ubuntu minimizado. Você pode editar o arquivo/etc/dpkg/dpkg.cfg.d/excludes
e comentar a seguinte linha:Então, você pode
apt update
e instalarman
emanpages