Adding software in the user's home directory

Adding software in the user's home directory:

Note: re-read the above paragraphs---adding software specifically on one machine is considered a last resort. Please discuss your needs with us.

  • Unless you know precisely what you're doing, you cannot drop in RPMs or other binary packages that are hard-coded to someone else's tree structure. Instead, you must do a somewhat custom install. These notes are guidelines, not step-by-step instructions.
  • Inside your home directory, create a directory called "bin". Also create a place to hold your software's source and/or installation tree. For example, you might create a directory called "src" or "apps" or "software".
  • If the software is open-source, the build procedure is probably to run some kind of "configure" script followed by various "make" scripts. The standard GNU configure script takes a parameter to specify the final install tree, which often defaults to /usr/local/. Thus you would do something similar to the following (but never run these commands as root!):
    ./configure --prefix=/home/myaccountname/
    make
    make install
    
  • If you simply copy a binary tree from CD or obtained over the web, then you probably simply need to add links to your "bin" directory:
    cd ~/bin
    ln -s ../apps/mysoftware/bin/foo foo
    
  • Now you should be able to run the software. You might verify it is in your PATH. The command "which foo", where "foo" is the name of the command, should return "/home/myaccountname/bin/foo". If not, then you might check your ".bash_profile" or ".bashrc" or whatever to ensure that "~/bin" is part of your PATH.

猜你喜欢

转载自gxrocky.iteye.com/blog/1532613