In general I follow the following workflow when I build any program (e.g. emacs
, tmux
, etc.)
/home/opt/[name of the program]/builds/[version]/
bin
lib
share
For example for a program like tmux
I have the following:
/my_local_opt/tmux/builds/1.7.-227/
bin
lib
share
I then create sym links in /home/bin/
pointing to the the specific builds that I have, and I never have to touch my PATH
variable, since I fix it to include /home/bin
.
E.g. For the example above, I would
- Create a sym link: from:
/home/bin/tmux
to:/my_local_opt/tmux/builds/1.7.-227/bin/tmux
- Have
PATH
only include/home/bin
However, I am not sure I can follow a similar approach for the man
(MANPATH
) and lib
(LD_LIBRARY_PATH
) paths.
For example, after I build
tmux
I notice that it creates:.. /share/man/man1/tmux.1
so I tried creating a symlink to this file from a place like
/home/share
and then fixingMANPATH
to include this path. But when I typedman tmux
it didn't work (it said "No manual entry for tmux
"). Why?How about
lib
? I thought I could perhaps fixLD_LIBRARY_PATH
to a specific directory for each program, and then use sym links to control which version gets included. Would this be a good idea?
More generally, is it a good idea to manage versions in a system using sym links? In the long run I am hoping to leave the sym links in a git repository to keep track of multiple configurations.
I don't have admin privileges in the machine where I build software, so I am hoping to use this as a way easily organize and manage my builds (without having to constantly edit my environment variables holding paths)