# R Installation

{% hint style="info" %}
Obtain administrative rights by requesting root access:
{% endhint %}

```
sudo -i
```

To install R version 4.0 or later on Ubuntu, add the CRAN (Comprehensive R Archive Network) repository to Ubuntu and install the R packages:

```
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'
apt update
apt install r-base r-base-dev
```

Start R:

```
R
```
