man command not working in Ubuntu 18.04

My man command is not working at all on my Ubuntu 18.04 machine. Unlike most of the cases I have found described in the internet, where there is an error message after calling man, I do not get any output/ error message at all

If I type which man

I will get /usr/bin/man. And I have checked with echo PATH that/usr/bin is on my PATH.

I have already tried sudo apt install --reinstall man-db, restarted the terminal, but no success.

Does anyone know what the problem can be?

6

3 Answers

I had the same problem and I solved it by running the following command:

sudo man <command>
1

If man --version gives the correct version info, but you are still not seeing output for man ls, man may not be using the right "pager" (the program that displays pages of information). You can explicitly designate less as the pager (see the -P option in the documentation:

man -P less ls

When -P isn't used, then man uses the pager designated by $MANPAGER or $PAGER. In my case, other programs, like git diff weren't working either, but adding the following to my ~/.bash_profile allowed me to simply run man ls with the expected results:

export PAGER=less

Notes: @Gonzalo's answer displayed output for me as well but required running with sudo. A question on a related discussion, led me to look into the pager issue.

I had all the issues described here: [SOLVED] 'Man' command does not work "No manual entry for ls".

My MANPATH environment variable was also wrong.

As instructed on that page, the quick is mainly about correcting MANPATH , for example, by entering the command below:

export MANPATH=/usr/share/man

That didn't work after reboot.

In my case, I had wrongly set MANPATH in my .zshrc file. Removing or correcting that was useful.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like