Installing cdt R prerequisites in Ubuntu without root

I wanted to use some of the tools from the causal discovery toolbox which require R and the pcalg package to be installed. As a complete newcomer to R, it was more hassle than I thought it would be to install R on an ubuntu server without root access. Here’s how to do it:

First install the dev version of curl so we have the libcurl headers

git clone
cd curl
autoreconf -fi
./configure --prefix=$HOME
make && make install

We then add the curl headers to the LD_LIBRARY_PATH:


We then fetch the source of R and install:

tar -xzf R-3.6.0.tar.gz
cd R-3.6.0
./configure --prefix=$HOME/R
make && make install

and add this R executable to the PATH:

export PATH="$HOME/R/bin/:$PATH"

and then install the prerequisites for pcalg

Chris Cundy
Chris Cundy
Machine Learning PhD Student

I’m a PhD student at Stanford University, advised by Stefano Ermon