Install R on Linux/Unix from Source

Install Python on Linux/Unix

Install R on Linux/Unix from Source
Image by Lukas 

R is an open-source programming language mainly used by statisticians and data scientists for performing statistical analysis. It is great for statistical computing with robust features for generating detailed statistical visualizations.

The R packages included in the default repositories are often outdated. We’ll install the latest R package from the CRAN repository.

How to Install R on Linux Distros (Debian, Fedora/Redhat, Ubuntu)

This guide covers the 4 specific ways to install R on Linux distributions.

System Requirements

  • RAM— 1 GB required, 2 GB recommended.
  • a non-root with sudo privileges on the user account.

1. Install R from the terminal

Type in the following commands in terminal.

Install dependencies

sudo apt install dirmngr gnupg apt-transport-https ca-certificates software-properties-common

Add the CRAN repository to your system

sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'

Install R by typing

sudo apt install r-base

Verify the R version

R --version

2. Download via Homebrew

You can download R by typing a homebrew command:  

brew install r

3. Download via XCode

Type the following command to install R through XCode:

xcode-select --install

4. Download R with the Web Browser

You can get the latest R package from cran.r-project.org


That’s it!

You are ready.