Something has gone wrong with both the man
and git log
commands on my Ubuntu system over the holidays. Neither produce any output, and I have no clues as to what the issue is, bar that they both should produce paginated commands. An example is below.
Some points
- I upgraded from Ubuntu 17.04 to 17.10 last night, but this hasn't changed anything.
less
andmore
work fine, as does everything else I've thought to try, including the rest of the git commands.- The problem persists on both
bash
andsh
.
Any help is greatly appreciated!
>>> echo Hello world > Foo.txt
>>> git init
Initialised empty Git repository in /home/eoin/GitHub/Fake/.git/
>>> git add Foo.txt
>>> git commit -m "Init"
[master (root-commit) 9e53556] Init
1 file changed, 1 insertion(+)
create mode 100644 Foo.txt
>>> git log
>>> git status
On branch master
nothing to commit, working tree clean
>>> ls
Foo.txt
>>> man
What manual page do you want?
>>> man --version
man 2.7.6.1
>>> man man
>>> man git
>>> man ls
>>> which man
/usr/bin/man
>>> which git
/usr/bin/git
>>> which less
/usr/bin/less
>>> which more
/bin/more
Updates
(With thanks to everyone who has commented)
- Reinstalling
git
orman
doesn't work. $MANPAGER
is not set in a new terminal.- Running
MANPAGER=/usr/bin/less man man
brings up the manual page as is expected. Great! MANPAGER=/usr/bin/less git log
doesn't do anything.man man
alone still doesn't do anything after running this, even though$MANPAGER
has been set in this terminal. I guess I need to makeMANPAGER
permanent in some way, but I don't know how as of yet. Good progress though.
- Running
sudo update-alternatives --config pager
brings up the following optionsThere are 3 choices for the alternative pager (providing /usr/bin/pager). Selection Path Priority Status ------------------------------------------------------------ * 0 /bin/less 77 auto mode 1 /bin/less 77 manual mode 2 /bin/more 50 manual mode 3 /usr/bin/w3m 25 manual mode
but I've tried them all, and
man man
still does nothing.less
andmore
work fine normally.less
andpager
seem sensible, as best I can tell>>> ls -l /usr/bin/less lrwxrwxrwx 1 root root 9 Jul 18 2016 /usr/bin/less -> /bin/less >>> eoin@eoin-SATELLITE-S50-B:~/GitHub/Fake$ ls -l /bin/less -rwxr-xr-x 1 root root 170728 Mar 24 2017 /bin/less >>> file /usr/bin/pager /usr/bin/pager: symbolic link to /etc/alternatives/pager >>> file /etc/alternatives/pager /etc/alternatives/pager: symbolic link to /bin/less
man man | cat
does print the man page!man man | less
works as well- as does
git log | less
. - This is a reasonable workaround, but I'm still none the wiser as to what the problem actually is.
Much later update
I've just run into the same problem again, on my work laptop, running Ubuntu 16.04. I mostly use this computer for scientific computing in python and R, so there's likely something in this set of programs that causes this problem. The solution below still fixes it.