-
Notifications
You must be signed in to change notification settings - Fork 599
Installing swirl on Linux
IMPORTANT: In the first line below, precise/
should be replaced with the version of Ubuntu you are using. Other examples: trusty/
, saucy/
, quantal/
, lucid/
. More information here.
$ sudo sh -c 'echo "deb http://cran.rstudio.com/bin/linux/ubuntu precise/" >> /etc/apt/sources.list'
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
$ sudo apt-get update
$ sudo apt-get install r-base-dev
$ R --version
Download from http://www.rstudio.com/ide/download/desktop.
This is required for the RCurl package, which swirl uses to download courses from the internet.
$ sudo apt-get install libcurl4-openssl-dev
> install.packages("swirl")
> swirl()
NOTE: If you upgrading from an earlier version of R, you may need to do install.packages("codetools")
before installing swirl.
Installation for other distributions in the Debian family should be similar.
- Install build-essential (needed by gcc to compile Rpackages containing C/C++ code)
- sudo apt-get install build-essential
- Install curl and libcurl4-openssl-dev (which will be needed for RCurl)
- sudo apt-get install curl
- sudo apt-get install libcurl4-openssl-dev
- Install R
- sudo apt-get install r-base
- Install RStudio if you are going to use it.
- Install swirl from the R prompt
- install.packages("swirl")
- or install from RStudio’s graphical interface. Be sure that install dependencies is checked.
- Download tar.gz file from http://cran.rstudio.com/src/base/R-3/R-3.1.0.tar.gz
- change the directory where the tar file is and then untar file using the command tar -zxvf R 3.1.0.targz
- ./configure
- make
- sudo make install
- cd bin
- ./R (Note: During the configure, it checks for dependencies of the libraries it needs. so if these dependencies are not met, it will take extra effort to install those dependencies. They may include libcurl4-openssl-dev, etc.)
This version of R will be 3.1.0 (Now you can add this working directory to your path variable to access R from anywhere.)
Now follow the steps to install swirl
- install.packages("swirl")
- library(swirl)
- swirl()
Often, the most challenging part of getting swirl to work on Linux is getting a recent version of R. We've found this blog post to be a helpful resource for installing R on a variety of Linux platforms: http://www.jason-french.com/blog/2013/03/11/installing-r-in-linux/