Skip to content

Instantly share code, notes, and snippets.

@kbsali
Created October 11, 2016 12:58
Show Gist options
  • Save kbsali/77acfc687141b9d02594c579da5bc6e1 to your computer and use it in GitHub Desktop.
Save kbsali/77acfc687141b9d02594c579da5bc6e1 to your computer and use it in GitHub Desktop.

swirl and its dependencies require R version 3.1.0 or later as well as a recent version of libcurl. This page is our attempt to collect any information that might be helpful to Linux users wanting to install swirl.


Ubuntu and its derivatives

These instructions have been successfully tested on:

  • Ubuntu 12.04 LTS (Precise Pangolin)
  • Ubuntu 16.04 LTS (Xenial)
  • Linux Mint 16 (Petra)

1. Install the most recent version of R. If you have R installed already, go to #2.

Official source: http://cran.r-project.org/bin/linux/ubuntu/README

$ sudo sh -c 'echo "deb http://cran.rstudio.com/bin/linux/ubuntu $(lsb_release -cs)/" >> /etc/apt/sources.list.d/cran.list'
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
$ sudo apt-get update
$ sudo apt-get install r-base-dev

Note also that using either of these instructions on a more modern distribution (e.g. Ubuntu 14.10, and probably 14.04) breaks the install, since the package at that source depends on libtiff4, but this has been removed (superseded by libtiff5). Happily, users can (and should) skip that step entirely, since a compatible package (R 3.1.1) is already included in that distribution.

PS. Thanks Charl and joegodbehere

2. Confirm that you have R version 3.1.0 or later. If not, return to #1.

$ R --version

3. Get RStudio (optional, but recommended).

Download from http://www.rstudio.com/ide/download/desktop.

4. Install libcurl.

This is required for the RCurl package, which swirl uses to download courses from the internet.

$ sudo apt-get install libcurl4-openssl-dev

If you're installing on Linux Mint 17:

$ sudo apt-get install libcurl4-openssl-dev r-base-dev libxml2-dev

5. From R or RStudio, install and run swirl.

> install.packages("swirl")
> library(swirl)
> swirl()

NOTE: If you upgrading from an earlier version of R, you may need to do install.packages("codetools") before installing swirl.


Other Resources


Fix for graphics not working on Ubuntu: https://gist.github.com/papas8105/2cbd941dceb1678918ea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment