APT isn't installing man pages by default

15,330

Solution 1

bash: man: command not found

means that you need to install the man-db package.

Manpages are installed by default in most cases, because Debian policy strongly encourages them to be shipped in the same package as the commands themselves:

Each program, utility, and function should have an associated manual page included in the same package.

Solution 2

The apt package which contain apt-get, also contains the manpage for apt-get (it even contains it in 7 languages), so if you have apt-get installed, you really should have the manpage. If you don't you've messed up your system in a way beyond what any packaging system can help you with.

Similar can be said for mkdir in the coreutils package, and for ping in iputils-ping.

But configuring APT to not install recommends (which I also always do, and believe to be a good thing), will mean that you don't get manpages of any program where the Debian developer making the package has chosen not to include it in the package, but in a package that is only a recommandation. I guess there's a lot of options, but some number of programs have manpages in the manpages package.

Solution 3

FWIW if you try and install Debian under Windows using WSL, then you do not get the man pages as default (I imagine this may also be a minimal installation). This is easily remedied using the method that Stephen Kitt suggests in a previous answer, but for the avoidance of doubt the command is:

sudo apt-get install man-db

If you install the build-essential packages (e.g. to install a C compiler), then you MAY need to also use:

sudo apt-get install manpages-dev
Share:
15,330

Related videos on Youtube

Wox ZrinH
Author by

Wox ZrinH

Updated on September 18, 2022

Comments

  • Wox ZrinH
    Wox ZrinH over 1 year

    I have installed a minimal Debian 9 through CD image. I configured Apt to not install recommended packages and now the system don't have any man page.

    man apt-get, man mkdir, or man ping doesn't show any man page; instead, I get

    bash: man: command not found
    
  • Pablo A
    Pablo A about 5 years
    Sure, but there is any reason why Debian 9 doesn't ship with man-db (and hence man) installed by default?
  • Stephen Kitt
    Stephen Kitt about 5 years
    @Pablo what makes you think it doesn’t? The OP explicitly performed a minimal install and configured apt to ignore “Recommends”. That’s not the default installation. man-db is “Priority: standard” and installed in the default installation, but not in the minimal one.
  • Pablo A
    Pablo A about 5 years
    OK, so Digital Ocean Debian default droplet (at least with 9.6 x64) installation is a minimal one.