Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I don't seem to be able to change the order of the default $MANPATH which is set in the /etc/profile with /usr/bin/manpath.
I tried changing the order of manpaths in /etc/manpath.config and then rebuilding the man databases using "mandb -s", but /usr/share/man always comes first, even when I set up all three sections with /usr/local/man first.
If you read the FHS, /usr/bin is supposed to only contain executables. If you put a directory in there i.e., you are violating its use. Most apps that are in /usr/bin have corresponding man pages in /usr/share/man. Anyway why do you need to reorder these paths? I don't think the order makes any difference because it a newer man pages exists in /usr/local/man or /usr/local/share/man, thats the one that will be used.
Test this on an unprivileged account. Export PATH statement (influences man searchpaths) with /usr/local first. Now execute "strace man --path nonexistantmanpage 2>&1 | grep ^open" and see if for each section it checks /usr/local first. If this works you now know what to do. Note that changing paths systemwide can lead to unwanted behaviour: different user accounts have different requirements. For instance root and system users (UID < 500) most likely don't need /usr/local first, and on systems where there's PAM helper apps in /usr/bin users with UID >= 500 (unprivileged users) need to have /usr/bin before /bin in their path. Per-user settings, in say /etc/profile.d/local.sh if you use Bash, would be a better option because it's easier managable. Contents of executable script /etc/profile.d/local.sh could be as easy as for instance:
I don't think the order makes any difference because it a newer man pages exists in /usr/local/man or /usr/local/share/man, thats the one that will be used.
I thought man used a "display first match found" approach?
I thought man used a "display first match found" approach?
Mmm, I always thought it used the latest. I'll have to check this and make sure I know what I am talking about.
EDIT: You are right unSpawn. I've done some reading and found out that if the MANPATH variable is set, the directories are searched in the order they appear and the first entry is read by man. What threw me is that on Suse, /usr/local/man and related directories are set to be searched first and not /usr/man or /usr/share/man.
You are right, the MANPATH is set in the exact order of the PATH command. Also, I wasn't getting the latest man page first I was always getting the first in the manpath.
I was examining the MANPATH as root, and whenn I tried another user "/usr/local/man" showed up first. Basically /etc/manpath.config adds what isn't there.
As for your other question as to why?
I installed source versions of some applications in /usr/local/ but I could not remove the application packages from the OS because they had so many dependencies (which I know were not always necessary) that I had to leave them in place.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.