I want to install Git locally to a user on a RHEL server (I don't have root access)
What would be your cleanest/ most organized way of installing software to a local user account?
- Installing everything in that users home directory?
- What would the directory layout look like?
- Would you install from source or RPM?
- If from RPM would you use YUM or RPM?
Best Answer
There are ways to install rpms in a user directory using
rpm
, but I don't believe it is straight-forward. I don't believe there is a way withyum
.My standard practice has become to compile from source to a
local
directory in my homeI download source as I would to
/usr/local
when I have root, e.g., in~/local/git
.When compiling I set the prefix to the
local
directoryI then add
~/local/bin
to my $PATH in.bash_profile
.Of course, the pain with installing from source is that you don't get automatic dependency resolution. If you find that you need to install dependencies, compile and install them as above. Then when you compile
git
, you need to update the compile flags so they look in the correct location for the dependency's libraries and include files: