2.2 Installing R: Ubuntu

20260820

Summary

Paste these commands into a terminal at the $ prompt:

sudo apt install r-recommended
curl https://raw.githubusercontent.com/eddelbuettel/r2u/refs/heads/master/inst/scripts/add_cranapt_resolute.sh -o add_cranapt_resolute.sh
sudo bash add_cranapt_resolute.sh
sudo apt install r-cran-amap r-cran-corrplot r-cran-devtools r-cran-hmisc \
     r-cran-fbasics r-cran-ggdendro r-cran-ggthemes \
     r-cran-lubridate r-cran-magrittr r-cran-mice r-cran-nnet \
     r-cran-party r-cran-randomforest r-cran-readr \
     r-cran-reshape r-cran-rpart r-cran-skimr r-cran-snowballc \
     r-cran-tidyverse r-cran-tm r-cran-vim r-cran-wordcloud
sudo apt install r-bioc-rgraphviz r-cran-ada r-cran-arules r-cran-arulesviz \
     r-cran-ckmeans.1d.dp \
     r-cran-descr  r-cran-ggcorrplot r-cran-ggtext \
     r-cran-janitor r-cran-naniar \
     r-cran-neuralnet r-cran-neuralnettools r-cran-rattle \
     r-cran-rocr r-cran-verification r-cran-wskm r-cran-xgboost

To now install Rattle on Ubuntu see Section 2.5.

Details

These instructions are for Ubuntu 26.04 LTS (resolute) and assume you have administrator access to Ubuntu and can thus use the sudo command. If you don’t have admin access the follow the instructions in Section 2.1.

In the above commands change resolute to noble, jammy, or focal, as appropriate, if you have an older release of Ubuntu.

We can utilise the advantages of a direct installation (no source download and build) with Debian packages for Ubuntu that are already compiled and ready to run. Only a small subset of the CRAN packages are pre-compiled in this way in the default distributions of Linux.

Dirk Eddelbuettel has built a full archive of CRAN packages ready to install on Ubuntu. All R packages can be installed as Debian packages on Ubuntu with names like r-cran-janitor, etc. The github repository for r2u provides the details.

Shell scripts are provided to setup your system to use R2U. For example add_cranapt_resolute.sh can be run as the admin user (root) on your Ubuntu computer to set up the R2U repository. This command works out of the box for a Ubuntu 26.04 LTS (named as resolute). Support for other versions of Ubuntu is available (e.g., 24.04 LTS aka noble).



Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0