3

After reading How do I manually install a man page file? (there is some ambiguity in this title) I did not get my answer.

How to install the related man pages for a certain command?

Take the command ls as an example, if the man page is not present, how can I install it?

5

You don’t need to install man pages manually, they are installed together with the command they describe. In the case of ls the program as well as the man page are part of the coreutils package, see the package’s file list or the output of dpkg -L coreutils:

$ dpkg -L coreutils | grep [^a-z]ls
/bin/ls
/usr/share/man/man1/ls.1.gz

If the man page wasn’t installed properly for any reason, just reinstall the package:

sudo apt install --reinstall PACKAGE

Though that is done automatically anytime a man page is added in the installation of a package, you can also update the database of man pages:

sudo mandb

If a command you seek help for is installed but has no man page, its help may be available elsewhere, see How can I get help on terminal commands? for alternatives.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.