R installation on Linux
Image credit: Unknown on Google
Table of Contents
Motivation
At Wageningen University & Research the Linux Operating System is supported on a best effort principle, meaning that it is supported as far as the knowledge of Facilities and Services Information Technology (FB-IT) reaches. FB-IT is supported by their colleagues maintaining the High Performance Computing Cluster Anunna, who have a lot of knowledge about the Linux Operating System, because it’s the Operating System used by Anunna.
On the other hand Linux users are generally users, who are very independent and know how to search for and implement solutions themselves. Being one of those Linux users within WUR myself I want to share in this post, how I have installed R on my Linux Systems within Wageningen University & Research.
This post will show how to install R on a Linux desk- or laptop computer.
Two types of Linux Operating Systems are described:
- Debian based, e.g. LMDE 7 Gigi (based on Debian 13 Trixie)
- Ubuntu based, e.g. Linux Mint 22.2 Zara (based on Ubuntu 24.04 LTS a.k.a. Noble Numbat)
Installation R
Debian based Linux Operating System
The installation procedure described here, combines information as provided on https://cloud.r-project.org/bin/linux/debian/. At the time of writing this post the described procedure installs R version 4.5.2 (nicknamed: [Not] Part in a Rumbles), under the assumption that the Linux Operating System is based on Debian 13 Trixie. When you are using Debian 12 Bookworm, replace trixie with bookworm in the commands provided below.
- Open a terminal (CTRL+ALT+T) and log in as administrator using the console command:
sudo -i
- Fetch and import the current key.
gpg --armor --export '95C0FAF38DB3CCAD0C080A7BDC78B2DDEABC47B7' | tee /etc/apt/trusted.gpg.d/cran_debian_key.asc
- Add Debian Trixie repository to the software sources using the command:
add-apt-repository "deb http://cloud.r-project.org/bin/linux/debian trixie-cran40/"
- Update the package information from all configured sources:
apt update
- Fully install R with dependencies:
apt install r-base libatlas3-base libopenblas-base r-cran-littler r-cran-coda r-doc-info r-doc-pdf python3-rpy2 r-mathlib
- Exit out of administrator mode using the
exitcommand.
Ubuntu based Linux Operating System
The installation procedure described here, combines information as provided on https://cloud.r-project.org/bin/linux/ubuntu/fullREADME.html. At the time of writing this post the described procedure installs R version 4.5.2 (nicknamed: [Not] Part in a Rumble), under the assumption that the Linux Operating System is based on Ubuntu 24.04 LTS Noble Numbat.
- Open a terminal (CTRL+ALT+T) and log in as administrator using the console command:
sudo -i
- Fetch and import the current key.
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
- Add Ubuntu Focal Fossa repository to the software sources using the command:
add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu noble-cran40/"
- Update the package information from all configured sources:
apt update
- Fully install R with dependencies:
apt install r-base r-cran-littler r-cran-rodbc r-doc-info r-doc-pdf r-mathlib jags littler python3-rpy2
- Exit out of administrator mode using the
exitcommand.