Compiling Without Sudo – How to Compile a Program Without Sudo Access

compilingnot-root-usersoftware installation

I am connected to a linux system with SSH in my college. I found that ctorrent is a console alternative of bitorrent. I have downloaded the tar.gz source but to compile/install it needs sudo access

Is there a way to install the program without sudo access?

I don't know a lot about linux and cannot make this answer work with ctorrent.

Best Answer

you can install it locally in your home directory. Ususally it can be done by specifying the parameter prefix for configure script.
For example,

./configure --prefix=$HOME

So, when you compile sources configured in such way, then you will call

make install

the binaries will install into you $HOME/bin
Also, you should alternate PATH variable.
You can do this in $HOME/.bashrc in next way

export PATH=$HOME/bin:$PATH

Anyway, if your sources don't have usual build system - you can just compile it, manually put in $HOME/bin and alternate PATH variable (to make it available without specifying the full path to binary).

Related Question