Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-29-2007, 03:04 AM   #1
LQ Newbie
Registered: Sep 2007
Posts: 1

Rep: Reputation: 0
Question how to install into home directory


I want to compile from source and install some programs and libraries inside my home folder without using root privileges. Please tell how to do it.

Old 09-29-2007, 03:36 AM   #2
Registered: Jan 2007
Location: Alberta Canada
Distribution: Fedora/Redhat/CentOS
Posts: 70

Rep: Reputation: 19
If the source packages you want to compile use 'configure' scripts, run ./configure --prefix=/home/{yourusername}/localapps (or similar path) in the package's source directory. The package will use the given path as its root dir and create bin,etc,usr,var and possibly other dirs under the given path when you run the 'make install' for the package.

You also need to set the environment var LD_LIBRARY_PATH to point any 'lib' dirs under the path given by --prefix. To set LD_LIBRARY_PATH, enter the command:

export LD_LIBRARY_PATH="/home/{yourusername}/localapps/usr/lib:/home/{yourusername}/localapps/lib"

To check that the LD_LIBRARY_PATH var is set, enter 'echo $LD_LIBRARY_PATH' at a command prompt and make sure it contains all the paths you need.

To know which paths to add to the LD_LIBRARY_PATH var, look for dirs containing {filename}.so files/links under your localapps dir. Add as many different paths as needed to the line.

And finally, you will need to add paths to your PATH environment var as well. Look for bin and sbin dirs under the localapps dir and add all that you find to your with the command:
export PATH="/home/{yourusername}/localapps/bin:{yourusername}/localapps/usr/bin:$PATH"

Don't forget to add the $PATH to the end of the PATH= line, or your shell will not be able to find the system wide programs.
To make these vars permanent, edit the .bash_profile file in you home dir and add the 2 lines to the end of file.

There are other ways to accomplish this as well, but this is a quick and relatively easy way.

Good Luck
Old 09-29-2007, 04:23 AM   #3
Registered: Feb 2006
Distribution: Fedora
Posts: 341
Blog Entries: 3

Rep: Reputation: 40
For an easy way out, I just run ./configure and make, and skip the make install. The executable is usually generated in the same folder I run the make in (so I can link it to ~/bin or somewhere else in my $PATH),and most apps have a config file or folder in ~/.appname anyway, so it works fine for me.
Old 09-29-2007, 04:25 AM   #4
Senior Member
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
There is no single set of instructions for all programs - different projects use different build systems.

What do you wish to build?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
New install Suse 10.2 - home directory nappy501 SUSE / openSUSE 11 08-13-2007 05:53 AM
Install lib in home directory? xeon123 Linux - Software 2 06-30-2007 04:52 PM
How to install to home directory. gloomz Linux - General 2 03-07-2007 01:24 PM
How to install programs in my home directory? cumbersome Linux - Software 15 06-26-2006 05:11 AM
rpm install to home directory gbanks Linux - General 3 07-12-2003 12:23 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:45 PM.

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