LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 01-05-2012, 10:39 AM   #1
haziz
Member
 
Registered: Jan 2012
Location: /dev/null
Distribution: Slackware, Fedora, Debian, Arch, Ubuntu
Posts: 101

Rep: Reputation: 4
How to have a Local Install have Precedence Over a System Wide Install?


I have a shell account on a Linux server (running Ubuntu 8.04) with user level permissions (but no root priveleges). The system has Git 1.5.x installed. I wish to run a more current version of git. I can compile from source and install in my home directory but would like the git commands to invoke my local, more current install, rather than the older system wide installation of Git.

How do I go about doing this?

Thanks.
 
Old 01-05-2012, 10:51 AM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
Here is how I do it...

1. Create the directory $HOME/MySystem
2. Add the following to my $HOME/.bashrc
Code:
if[ -d $HOME/MySystem ]; then
    PATH="$HOME/MySystem/bin:$HOME/MySystem/usr/bin:$PATH"
    export PATH
fi
3. When building software, pass --prefix=$HOME/MySystem/usr to the configure script.

Step 2 ensures the version in $HOME/MySystem will be found before the system-wide version. Step 3 will need to be modified as necessary depending on whether the package uses autotools, cmake, etc.

This is also how I manage Python and Perl modules. When I use easy_install or pip to install Python modules/packages they go to $HOME/MySystem/usr/lib64/python2.7/. Similarly for using CPAN to install Perl modules.
 
Old 01-05-2012, 10:53 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Assuming that you are using Bash as shell (which should be standard on 8.04), just edit the file ~/.bashrc and edit the PATH variable in it, so that the path to the directory with the new git in it stands in front. Logout and in again after that. Now the system will search for programs you invoke in that path first and will find the newer git and use it.

EDIT: weibullguy's approach looks better.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Yum local install - package and all dependencies in local directory lppatmore Linux - Newbie 6 02-21-2015 02:53 AM
I lost my wide screen settings after ati fglx install kkempter Linux - Software 0 01-05-2006 03:06 PM
Local webserver -- How to deny all client install their local web server--Please help b:z Linux - Networking 13 04-16-2005 07:11 PM
*system-wide* KDE install, how? webvandals Linux - Software 5 03-05-2004 11:48 PM
Restoring system-wide settings to post-install condition Ac. K. Linux - Software 2 01-15-2004 01:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration