Install curl without being root

curlnot-root-usersoftware installation

I was trying to install a R package called "devtools", but without success.

ERROR: dependencies ‘curl’, ‘openssl’ are not available for package ‘httr’
* removing ‘/misc/u32/huang/.R325/lib64/R/library/httr’
ERROR: dependencies ‘httr’, ‘git2r’ are not available for package ‘devtools’
* removing ‘/misc/u32/huang/.R325/lib64/R/library/devtools’

It turned out that I need to install "Curl" which requires being root to execute the installation command

Is there anyway to work around the problem? Maybe just install curl underway local directory? Tsk!

Best Answer

You can install curl as non-root using a prefix where you have write permissions.

Download curl sources, untar and cd into the extracted directory. Then

./configure --prefix=$HOME/usr
make
make install

and add this to you ~/.profile:

PATH="$HOME/usr/bin:$PATH"
export PATH
LD_LIBRARY_PATH="$HOME/usr/lib:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH
PKG_CONFIG_PATH="$HOME/usr/lib/pkgconfig:$PKG_CONFIG_PATH"
export PKG_CONFIG_PATH
MANPATH=$HOME/usr/share/man:$MANPATH
export MANPATH

Note, after you've setup such $HOME/usr in your ~/.profile once you can easily install most other packages to that prefix too.

Related Question