LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to install into home directory (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-install-into-home-directory-588154/)

ishanarora 09-29-2007 02:04 AM

how to install into home directory
 
Hi

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.

Thanks

anotherlinuxuser 09-29-2007 02:36 AM

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

indeliblestamp 09-29-2007 03:23 AM

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.

matthewg42 09-29-2007 03:25 AM

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

What do you wish to build?


All times are GMT -5. The time now is 08:37 PM.