-
Notifications
You must be signed in to change notification settings - Fork 599
Installing swirl on Linux
These instructions have been successfully tested on:
- Ubuntu 12.04 LTS (Precise Pangolin)
- Linux Mint 16 (Petra)
IMPORTANT: In the first line below, precise/
should be replaced with the version of Ubuntu you are using. Other examples: trusty/
, saucy/
, quantal/
, lucid/
. If you're not sure which version you have, type cat /etc/*release
at the command line.
Official source: http://cran.r-project.org/bin/linux/ubuntu/README
$ 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.
- 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/