Local installs

From Peyton Hall Documentation
Jump to navigation Jump to search

Even with the amount of software available on the network, sometimes you can't live without a certain program. Or maybe you want to install it on your laptop, but don't want to have to bother with putting it in a "normal" system location (and having to be root or an administrator to deal with it). Here's a trick which I've started doing on my Mac, and you can do on any other machine to make it simple to install software without needing administrative privileges (and it's easy to clean up if you reinstall/remove the software later on, too!)

  1. Create a directory where your software installs will live.
    mkdir ~/Installs
  2. Create a directory named for the program you wish to install.
    mkdir ~/Installs/FooGram
  3. Download the source to that directory. Uncompress it as usual.
    This will normally create a directory called ~/Installs/FooGram/FooGram-1.2.3 for example. This directory contains the source.
  4. Add a prefix command to your './configure' command.
    ./configure --prefix=~/Installs/FooGram
    This tells configure that you want to install the software not in the normal /usr/bin or /usr/local/bin location, but in a directory tree based from ~/Installs/FooGram.
  5. When done compiling and installing, you will probably have directories like ~/Installs/FooGram/bin, ~/Installs/FooGram/lib and ~/Installs/FooGram/share, perhaps more.
  6. Tell your shell where to look, so you can run the program just like any other.
    Have a look at the dotfiles article for information on setting this up and links to examples.

Later on, if you decide to remove the program, you need only delete the entire ~/Installs/FooGram directory and it's gone - no more hunting in multiple shared/bin/sbin/lib/man directories to find all the files that go with some bit of software. Or you can move the directory out of the way, install a newer version, and then remove the old one when you're sure it's working as expected.

NOTE:

You should not install a program to your network home directory. /u is backed up regularly, and storing a program there is wasteful (and expensive). Instead, install programs to scratch disks, which are still accessible by most of the machines in the building. The above example is written if you're looking to install things on a laptop or home machine, but it's not difficult to adapt the instructions to a scratch disk install.