Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install R on Ubuntu 17.10
# Install R
sudo apt-get update
sudo apt-get install gdebi libxml2-dev libssl-dev libcurl4-openssl-dev libopenblas-dev r-base r-base-dev
# Install RStudio
cd ~/Downloads
wget https://download1.rstudio.org/rstudio-xenial-1.1.383-amd64.deb
sudo gdebi rstudio-xenial-1.1.383-amd64.deb
printf '\nexport QT_STYLE_OVERRIDE=gtk\n' | sudo tee -a ~/.profile
# install common packages
R --vanilla << EOF
install.packages(c("tidyverse","data.table","dtplyr","devtools","roxygen2","bit64"), repos = "https://cran.rstudio.com/")
q()
EOF
# Export to HTML/Excel
R --vanilla << EOF
install.packages(c("htmlTable","openxlsx"), repos = "https://cran.rstudio.com/")
q()
EOF
# Blog tools
R --vanilla << EOF
install.packages(c("knitr","rmarkdown"), repos='http://cran.us.r-project.org')
q()
EOF
sudo apt-get install python-pip
sudo pip install markdown rpy2==2.7.8 pelican==3.6.3
# PDF extraction tools
sudo apt-get install libpoppler-cpp-dev default-jre default-jdk r-cran-rjava
sudo R CMD javareconf
R --vanilla << EOF
library(devtools)
install.packages("pdftools", repos = "https://cran.rstudio.com/")
install_github("ropensci/tabulizer")
q()
EOF
# TTF/OTF fonts usage
sudo apt-get install libfreetype6-dev
R --vanilla << EOF
install.packages("showtext", repos = "https://cran.rstudio.com/")
q()
EOF
# Cairo for graphic devices
sudo apt-get install libgtk2.0-dev libxt-dev libcairo2-dev
R --vanilla << EOF
install.packages("Cairo", repos = "https://cran.rstudio.com/")
q()
EOF
@emilBeBri

This comment has been minimized.

Show comment
Hide comment
@emilBeBri

emilBeBri Oct 22, 2017

Very nice! But I'm very puzzled that you don't include code to include the CRAN depository for the newest version of R? As I see it, this is the most essential part of an R-installation?

emilBeBri commented Oct 22, 2017

Very nice! But I'm very puzzled that you don't include code to include the CRAN depository for the newest version of R? As I see it, this is the most essential part of an R-installation?

@R3DDY97

This comment has been minimized.

Show comment
Hide comment
@R3DDY97

R3DDY97 Nov 3, 2017

Hi,
Good one

End of third line has extra letter v

and

from line 21-26 might be extra code i think

# Blog tools R --vanilla << EOF install.packages(c("knitr","rmarkdown"), repos='http://cran.us.r-project.org') q() EOF sudo pip install markdown rpy2==2.7.8 pelican==3.6.3

R3DDY97 commented Nov 3, 2017

Hi,
Good one

End of third line has extra letter v

and

from line 21-26 might be extra code i think

# Blog tools R --vanilla << EOF install.packages(c("knitr","rmarkdown"), repos='http://cran.us.r-project.org') q() EOF sudo pip install markdown rpy2==2.7.8 pelican==3.6.3

@Shuyib

This comment has been minimized.

Show comment
Hide comment
@Shuyib

Shuyib Mar 7, 2018

This is amazing! Thank you!

Shuyib commented Mar 7, 2018

This is amazing! Thank you!

@songhune

This comment has been minimized.

Show comment
Hide comment
@songhune

songhune Mar 19, 2018

thank you for your kind explanation, but it seems that dependency issue came up...

The following packages have unmet dependencies:
r-base : Depends: r-base-core (>= 3.4.4-1xenial0) but it is not going to be installed
Depends: r-recommended (= 3.4.4-1xenial0) but it is not going to be installed
Recommends: r-base-html but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I got stuck since this msg came up.

thank you for your kind explanation, but it seems that dependency issue came up...

The following packages have unmet dependencies:
r-base : Depends: r-base-core (>= 3.4.4-1xenial0) but it is not going to be installed
Depends: r-recommended (= 3.4.4-1xenial0) but it is not going to be installed
Recommends: r-base-html but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I got stuck since this msg came up.

@andreaschandra

This comment has been minimized.

Show comment
Hide comment
@andreaschandra

andreaschandra Apr 13, 2018

are you still stuck on that error? @songhune

are you still stuck on that error? @songhune

@rbenel

This comment has been minimized.

Show comment
Hide comment

rbenel commented May 17, 2018

I am :(

@superHubert

This comment has been minimized.

Show comment
Hide comment
@superHubert

superHubert May 18, 2018

isn't xenial a 16.04/16.10 vesrion and not 17.xx (artful)?
the codes mentions xenial in several places:
wget https://download1.rstudio.org/rstudio-xenial-1.1.383-amd64.deb
sudo gdebi rstudio-xenial-1.1.383-amd64.deb

Is it alright?

isn't xenial a 16.04/16.10 vesrion and not 17.xx (artful)?
the codes mentions xenial in several places:
wget https://download1.rstudio.org/rstudio-xenial-1.1.383-amd64.deb
sudo gdebi rstudio-xenial-1.1.383-amd64.deb

Is it alright?

@colby-j-wise

This comment has been minimized.

Show comment
Hide comment
@colby-j-wise

colby-j-wise Jul 10, 2018

Thanks for the explanation. Similar to the R-blogger post setup.

@superHubert, RStudio verison for xenial from website says for Ubuntu 16.04+ -- check website/html link
https://www.rstudio.com/products/rstudio/download/

I'm using the latest 1.1.453 /Ubuntu 17.10

colby-j-wise commented Jul 10, 2018

Thanks for the explanation. Similar to the R-blogger post setup.

@superHubert, RStudio verison for xenial from website says for Ubuntu 16.04+ -- check website/html link
https://www.rstudio.com/products/rstudio/download/

I'm using the latest 1.1.453 /Ubuntu 17.10

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