I recently installed TeX-Live and attempted to add its man to the manpath. It didn't work and couldn't find entries, and I didn't care too much. However, (I suppose) after a system restart, the man
command isn't working altogether.
:~$ man man
bash: /mnt/HDD/texlive/2021/bin/x86_64-linux/man: cannot execute binary file: Exec format error
I don't know why it is looking for the TeX Live's version.
:~$ whereis man
man: /usr/bin/man /usr/local/man /usr/share/man /mnt/HDD/texlive/2021/bin/x86_64-linux/man /usr/share/man/man7/man.7.gz /usr/share/man/man1/man.1.gz
I had modified both ~/.bashrc
and /etc/manpath.config
based on this accepted answer, both of which I restored back. I tried source
ing the new bashrc file, logging out and in, or restarting the system, but I cannot seem to get the man
working again.
What is the problem here, how can I restore the man
, and what can I be overlooking? To be clear, I don't care about successfully adding TeX Live to the man page, I just want to get my man
command functional again.
EDIT: Additional informations
Here is the path variables: (I broke the output int multiple lines and erased colons to have it easier to read here.)
:~$ echo $PATH
/mnt/HDD/texlive/2021/bin/x86_64-linux
/home/<username>/.local/bin
/usr/local/sbin
/usr/local/bin
/usr/sbin:/usr/bin
/sbin
/bin
/usr/games
/usr/local/games
/snap/bin
The topmost one should be the one I need to build latex projects, so I suppose it shouldn't cause the problem.
Also, echo $MANPATH
doesn't print anything.
When it comes to what I did, I didn't do anything but modifying these two files.
I added the following lines to $HOME/.bashrc
PATH=/mnt/HDD/texlive/2021/bin/x86_64-linux:$PATH; export PATH
MANPATH=/mnt/HDD/texlive/2021/texmf-dist/doc/man:$MANPATH; export MANPATH
INFOPATH=/mnt/HDD/texlive/2021/texmf-dist/doc/info:$INFOPATH; export INFOPATH
And then I added the following line at the end of the section # set up PATH to MANPATH mapping
in the /etc/manpath.config
MANPATH_MAP /mnt/HDD/texlive/2021/bin/x86_64-linux /mnt/HDD/texlive/2021/texmf-dist/doc/man
I then run source ~/.bashrc
, and tried to access man pages of some random TeX stuff, and encoutered with a message stating that the related entry was not found. Hence, even though it wasn't working with TeX, the man
command was functional still.
I believe I left it here, and noticed that the problem I described few days later. As I said, I undid everything I mentioned above.
Because some time has passed, and I didn't necessarily know what I was doing especially with the manpath.config
file, I might have done something else, but I don't recall doing anything else. If you have suggestions of potential actions that can cause a problem like this, or a way of solving this regardless, (which doesn't involve reinstalling the linux or anything, of course) I will appreciate.
type man
(ortype -a man
) will likely be more diagnostic as to what your bash shell is seeing thanwhereis man
whereis man
in reverse order. I don't know what to do with that though.echo "$PATH"
and its result to your question. Also explain how you "attempted to add its man to the manpath" (I see you've linked to a question, but please state here which commands you ran.) If you undo the changes you made you'll find it all works once more.echo $PATH
, do you really get newlines between most of the directories, or have you edited the output? I would expect a list of:
-delimited directory paths, not lines of directory paths.